Skip to content

feat(wallet): decide a failed Platform payment by the wallet's payment class - #1432

Draft
romchornyi wants to merge 2 commits into
feat/external-send-lock-heldfrom
feat/external-send-payment-class
Draft

romchornyi wants to merge 2 commits into
feat/external-send-lock-heldfrom
feat/external-send-payment-class

Conversation

@romchornyi

Copy link
Copy Markdown
Contributor

Stacked on #1423 (base feat/external-send-lock-held). Draft: it needs dashpay/platform#5928, which is not merged yet.

What

The new Send decided whether a failed Platform payment left the wallet from a list of PlatformWalletError types kept in the app. dashpay/platform#5928 moves that decision into the Rust wallet: every PlatformWalletError now carries a payment class (delivery: not sent, maybe sent, lock held). This PR makes the app read it.

  • SendOutcome maps a PlatformWalletError by delivery: .notSent → not sent (the type only picks the reason's words); .maybeSent, .lockHeld or unclassified → in progress. A held lock with its funding type still comes from the coordinator as lockHeld.
  • LiveCoreTwoStepSend.lockMayExist (Core → Identity) reads the same class.
  • Pattern matches across the app adapted to the SDK's new payment payload on every case (AssetLockFailureStore, UsernameMarketplaceService, WalletSendService, EvonodeWithdrawalViewModel, MasternodeUnbanViewModel).
  • ADR-0054.

Why: a wallet error the app's list did not know read as "in progress" although nothing was sent (for example an identity lookup that fails before any spend), and the list could drift the other way. With the class, a new wallet error code needs no app change. Related: #1427 (the wallet classes a nonce mismatch as maybe sent, so it stays in progress).

Pin

.platform-ref → 79d5fe45ac on test/external-send-delivery = #5928 head 730a15273e + its review fixes (nonce docs, example apps read the class, the wallet owns a panicked payment's class). Development-only; moves to the merged commit once #5928 lands.

Testing

  • SendOutcomeMappingTests, ExternalSendExecutorTests, ConfirmViewModelTests, ExternalSendFlowTests, SendOutcomeRouterTests, AssetLockDiagnosticsTests, SendAmountViewModelTests, AddressViewModelTests: 513 tests, all green on the simulator against the pinned SDK; the whole test target compiles.
  • New: the class decides over the type (an "unconfirmed" type classed not sent is not sent, a "rejected" type classed maybe sent stays in progress), unclassified and lock-held stay in progress, nonce mismatch classed maybe sent stays in progress.
  • Not run: the full suite, Maestro flows (no visible UI change).

🤖 Generated with Claude Code

romchornyi and others added 2 commits November 16, 2026 18:18
…fixes (test branch, development only)

test/external-send-delivery = #5928 head 730a15273e + the round's fixes; carries the Rust-owned payment class on every PlatformWalletError case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… payment class

SendOutcome reads PlatformWalletError.delivery (dashpay/platform#5928): not sent only when the wallet classes the failure not sent, in progress for maybe sent, a held lock or an unclassified error; the error type only picks the reason's words. LiveCoreTwoStepSend.lockMayExist reads the same class. The app's type list is gone, so a new wallet error code needs no app change (ADR-0054). Pattern matches adapted to the SDK's payment payload on every PlatformWalletError case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@thepastaclaw

Copy link
Copy Markdown
Contributor

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 5c90cf2. Normal review starts when eligible; priority review starts as soon as a slot is available.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants