fix: cp-8.0.0 musd fiat deposit amount data error prefixes#32314
Conversation
…for amount-data-callback
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The PR makes three focused changes:
Since Money Account deposit/withdrawal flows involve on-chain transactions that go through the confirmation UI, SmokeConfirmations is also selected per the SmokeMoney tag description ("When selecting SmokeMoney for Card Add Funds or similar flows that execute swaps, also select SmokeSwap and SmokeConfirmations"). The test files are unit tests only and don't affect E2E test selection. No navigation, browser, snaps, network, or account management changes are present. Performance Test Selection: |
| provider, | ||
| }); | ||
| } catch (error) { | ||
| throw prefixError(error, MONEY_ACCOUNT_DEPOSIT_ERROR_PREFIX); |
There was a problem hiding this comment.
Very neat debugging mechanism 😄
|



Summary
Applies the two-level error prefix pattern to
getAmountDatainamount-data-callback.ts:getAmountDatafunction):Update Amount Data:buildMoneyAccountDepositBatch):Money Account Deposit:A failure during deposit calldata building now surfaces as:
This matches the naming convention on the core side (MetaMask/core#9250) and in the
useUpdateTransactionPayAmounthook, making it immediately clear from the error message that the failure occurred in the amount data callback and specifically in the money account deposit build step.Also included
disableUpgrade: trueadded touseMoneyAccountdeposit and withdrawaladdTransactionBatchcalls (the Money Account is always already upgraded on Monad)error-prefix.ts:reasonin CALL_EXCEPTION handling made optional to handle ethers errors wherereasonmay benullNote
Low Risk
Targeted error-handling and transaction-batch flags for money account flows; no auth or broad architectural changes.
Overview
Improves mUSD / money account deposit failures during MM Pay amount updates by wrapping
getAmountDatain a two-levelprefixErrorpattern (Update Amount Data:→Money Account Deposit:), so users and support can tell the failure is in the amount-data callback and specifically in deposit calldata building.prefixErrornow treats ethersCALL_EXCEPTIONreasonas optional: whenreasonis missing or non-string, messages useeth_call failed - <method>instead of falling back to the full verbose ethers string.Money account deposit and withdrawal
addTransactionBatchcalls setdisableUpgrade: truebecause the money account is already upgraded on Monad, avoiding unnecessary upgrade logic in the batch pipeline.Reviewed by Cursor Bugbot for commit 128eb69. Bugbot is set up for automated code reviews on this repo. Configure here.