feat(platform-wallet): reserve DashPay payout addresses without Core funding - #4623
feat(platform-wallet): reserve DashPay payout addresses without Core funding#4623PastaPastaPasta wants to merge 1 commit into
Conversation
|
Warning Review limit reachedNext included review available in 49 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🕓 Queued for automated review — 56th in line, estimated start in ~77 h (commit d7d0224)
|
Supersedes #4614 (re-opened from the main repo so the Rust/Swift CI jobs run on it).
Issue being fixed or feature implemented
DashPay contact payments currently expose a combined address-resolution and Core-funded send operation. Wallets with Platform or shielded funds cannot obtain a fresh DIP-15 contact destination without selecting transparent Core inputs.
What was done?
Add
DashPayView::reserve_payment_addressand the SwiftManagedPlatformWallet.reserveDashPayPaymentAddress(fromIdentityId:toContactIdentityId:)wrapper through the C FFI. The operation completes the seed-verified deferred contact-crypto drain, consumes an address from the authoritative wallet/owner/contact external account pool, and persists and flushes its used flag before returning it.Core sends and external payout reservations share the derivation helper and a per-wallet gate that keeps their pool snapshots ordered. Core broadcasts release the gate while awaiting the network, then reacquire it before a definitive rejection's address rollback. The Swift wrapper retains its mnemonic resolver throughout the FFI call and frees the returned string.
Callers reserve only when submitting a confirmed payment. Exposed addresses stay consumed after cancellation, rejected withdrawal, or an unknown outcome; this API does not submit the withdrawal or record payment history. The companion iOS change owns the submitted-withdrawal history.
How Has This Been Tested?
cargo clippy -p platform-wallet -p platform-wallet-ffi --lib(only pre-existing upstream warnings).cargo fmt -p platform-wallet -p platform-wallet-ffi --checkandgit diff --check.Real testnet validation used two registered DashPay contacts: a 0.02 DASH Platform withdrawal with zero Transparent balance and a user-submitted 0.1 DASH Shielded withdrawal paid the reserved addresses. Recipient receipt verification used a combined test build with the separate AssetUnlock discovery fix in dashpay/rust-dashcore#1004. Screenshots and exact build provenance.
The receipt fix needs a separate upstream SDK dependency update. This PR only adds address reservation and leaves the existing rust-dashcore dependencies unchanged.
Breaking Changes
None. The existing Core-funded send API remains available.
Checklist:
For repository code-owners and collaborators only
This pull request was created by Codex.