fix: money account withdraw update transaction config when recipient changes#28803
fix: money account withdraw update transaction config when recipient changes#28803jpuri wants to merge 32 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
| Engine.context.TransactionPayController.setTransactionConfig( | ||
| transactionId, | ||
| (config) => { | ||
| config.refundTo = address as Hex; |
There was a problem hiding this comment.
Oh, I thought we already had a recipient property too but I was wrong.
Will need to add that to the pay controller so it doesn't always match the from.
There was a problem hiding this comment.
But if this is just for the withdraw flow, then the from should become the selected / gas account who we want to be the recipient anyway? So maybe we don't need to change anything?
There was a problem hiding this comment.
PR is updated to use field accountOverride in config. I still need to work on core PR to add this field.
| @@ -142,7 +142,12 @@ export const CustomAmountInfo: React.FC<CustomAmountInfoProps> = memo( | |||
| const handleRecipientAccountSelected = useCallback( | |||
There was a problem hiding this comment.
Outside the scope of this PR, but first time I'm seeing this code.
Could we modularise this a bit more and encapsulate this logic within the AccountSelector?
Or if you don't want to couple it to MetaMask Pay, we could wrap it and make a PayAccountSelector?
Just to make the logic a bit more readable and easier to test, plus stops this info component becoming a monolith.
I see we're only using the state for an alert, but if we're storing it on the pay controller, we could use a standard alert hook that reads the controller state?
There was a problem hiding this comment.
Good point I updated PR to address this.
There was a problem hiding this comment.
This point is not clear to me:
I see we're only using the state for an alert, but if we're storing it on the pay controller, we could use a standard alert hook that reads the controller state?
…selected account changes
…metamask-mobile into mmpay_recipient_update
…metamask-mobile into mmpay_recipient_update
…metamask-mobile into mmpay_recipient_update
|
✅ E2E Fixture Validation — Schema is up to date |
AI PR Analysis🚫 Merge safe: false | 🟠 Risk: high
AI analysis did not complete. Manual review recommended. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
For money account withdraw update transaction config when recipient changes.
Changelog
CHANGELOG entry:
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1187
Manual testing steps
Screenshots/Recordings
Screen.Recording.2026-04-16.at.11.48.49.PM.mov
Screen.Recording.2026-04-16.at.11.39.13.PM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Touches money-account confirmation flows and pay-token selection/disablement logic; regressions could block users from selecting pay tokens or confirming transactions if accountOverride state isn’t set/propagated correctly.
Overview
Money Account confirmations now use a TransactionPayController-backed
accountOverrideinstead of editingtxParamsdirectly. This introducesPayAccountSelectorplus a newuseTransactionAccountOverridehook/selector to read/write the chosen account viaTransactionPayController.setTransactionConfig.CustomAmountInfogainssupportAccountSelection(enabled for money-account deposit/withdraw) and disablesPayTokenAmountand the confirm button until an override is chosen.PayWithRowis updated to respect a newuseMoneyAccountPayTokenhook: it blocks pay-token editing while awaiting account selection, shows a placeholder label (confirm.label.payment_method), and prioritizes a money-account display token/fallback for withdraw.Also updates developer money-account test transactions (recipient/token address and transfer amount) and includes new/updated unit tests around the new hooks and components, plus a small
AccountSelectorpadding tweak.Reviewed by Cursor Bugbot for commit 32172a6. Bugbot is set up for automated code reviews on this repo. Configure here.