Repository navigation
fix(platform-wallet): raise the invitation cap to cover the contested username tier #4362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
25534db
302dc2b
7b6ca46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,15 +45,19 @@ use crate::wallet::identity::network::contact_requests::ContactCryptoProvider; | |
|
|
||
| use super::*; | ||
|
|
||
| /// Hard cap on the amount an invitation can lock (0.05 DASH). The voucher is a | ||
| /// Hard cap on the amount an invitation can lock (0.26 DASH). The voucher is a | ||
| /// bearer credential, so the blast radius of a leaked link is bounded here in | ||
| /// Rust — not just in the UI. Sized for onboarding: the invitee spends the | ||
| /// voucher on identity creation **plus** a normal DPNS name (~0.03 DASH — the | ||
| /// legacy `DASH_PAY_FEE`), so the previous 0.01 cap was actually below a usable | ||
| /// invitation and rejected its own onboarding default. The contested/premium-name | ||
| /// tier (~0.25 DASH) is deferred until contested-name-via-invite claim exists; | ||
| /// raise this cap when it does. | ||
| pub const MAX_INVITATION_DUFFS: u64 = 5_000_000; | ||
| /// Rust — not just in the UI. Sized for onboarding at BOTH username tiers: the | ||
| /// invitee spends the voucher on identity creation **plus** a DPNS name — a | ||
| /// normal name (~0.03 DASH, the legacy `DASH_PAY_FEE`) or a contested/premium | ||
| /// name (~0.25 DASH, `DASH_PAY_FEE_CONTESTED`), with the 0.01 margin covering | ||
| /// the create/claim fees. The earlier 0.05 value deferred the contested tier | ||
| /// "until contested-name-via-invite claim exists" — the claim path is | ||
| /// amount-agnostic and contested-invite claims are verified working, and the | ||
| /// Android wallet has funded contested invitations at 0.25 since 2024, so the | ||
| /// deferral is over. (The pre-merge 0.01 iteration was below even a usable | ||
| /// non-contested invitation and rejected its own onboarding default.) | ||
| pub const MAX_INVITATION_DUFFS: u64 = 26_000_000; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Add a regression test for the contested invitation amount No test independently exercises the amount-cap branch or references source: ['codex'] |
||
|
|
||
| /// Floor on the amount an invitation can lock (0.003 DASH). A voucher funds a | ||
| /// Platform identity operation, and creating an identity — which is what the | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Suggestion: Update clients that still mirror the old invitation cap
This change makes the repository's explicit cap mirrors inconsistent with the Rust source of truth.
packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/DashPay/CreateInvitationSheet.swiftstill definesmaxInvitationDuffsas5_000_000, and its amount parser rejects larger values, so that bundled client cannot create a 0.25 DASH contested invitation even though the corrected Rust API accepts it. The associated Swift text, Kotlin KDoc and example guidance,Info.plist, anddocs/dashpay/DIP15_INVITATIONS_SPEC.mdalso still advertise the old 0.05 DASH limit. Update these mirrors to 26,000,000 duffs so the client behavior and documentation match the newly raised cap.source: ['codex']