Skip to content

fix: add Update Amount Data outer prefix to money account deposit amount callback#32312

Closed
matthewwalsh0 wants to merge 1 commit into
mainfrom
fix/musd-error-prefixes-mobile
Closed

fix: add Update Amount Data outer prefix to money account deposit amount callback#32312
matthewwalsh0 wants to merge 1 commit into
mainfrom
fix/musd-error-prefixes-mobile

Conversation

@matthewwalsh0

Copy link
Copy Markdown
Member

Summary

Adds a two-level error prefix to the money account deposit amount-update callback in useUpdateTransactionPayAmount:

  • Outer (updateTransactionPayAmount deposit block): Update Amount Data:
  • Inner (applyMoneyAccountAmountUpdates / syncMoneyAccountDepositRequiredAssets): Money Account Deposit: (pre-existing)

A failure during amount data update now surfaces as:

Update Amount Data: Money Account Deposit: <original error>

This mirrors the naming convention introduced on the core side (MetaMask/core#9250) and makes it immediately clear from the error message that the failure occurred in the deposit amount-update step.

Changes

  • useUpdateTransactionPayAmount.ts: Add UPDATE_AMOUNT_DATA_ERROR_PREFIX constant; wrap the moneyAccountDeposit branch in a try-catch that applies the outer prefix
  • useUpdateTransactionPayAmount.test.ts: Update three error-propagation assertions to assert the full prefix-chained message

@mm-token-exchange-service mm-token-exchange-service Bot added team-confirmations Push issues to confirmations team INVALID-PR-TEMPLATE PR's body doesn't match template labels Jun 24, 2026
@mm-token-exchange-service

Copy link
Copy Markdown

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMoney, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR modifies useUpdateTransactionPayAmount.ts to wrap the moneyAccountDeposit transaction handling in a try/catch block, prefixing errors with 'Update Amount Data: '. The test file updates assertions to match the new error message format.

This is a low-risk error handling improvement that:

  1. Affects the Money Account Deposit flow → SmokeMoney (MetaMask Card/fiat deposit flows)
  2. Lives in the confirmations/hooks/pay directory and affects transaction confirmation behavior → SmokeConfirmations

Per tag descriptions: SmokeMoney covers card Add Funds (Deposit/Swap paths), and when selecting SmokeMoney for flows that execute transactions, SmokeConfirmations should also be selected.

No performance impact expected — this is purely an error handling change with no effect on rendering, data fetching, or app startup.

Performance Test Selection:
The change is purely an error handling improvement (adding try/catch with error prefix) in the Money Account Deposit hook. There is no impact on rendering performance, data fetching, app launch, or any other performance-sensitive flow.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant