fix(confirmations): cp-8.0.0 skip initial gas estimate for sponsored money account transactions#32129
Conversation
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:
SmokeMoney: Directly affected - these hooks power the Money account deposit and withdrawal flows (Card Add Funds and withdrawal). SmokeConfirmations: The SmokeSwap: Not selected because the changes are specifically to Money account deposit/withdrawal (not swap flows). The SmokeMoney description mentions SmokeSwap for "Add Funds (Deposit/Swap paths)" but the change here is specifically about gas sponsorship for Monad Mainnet, not the swap path itself. No performance tests are needed as this is a logic change to gas estimation parameters, not a rendering or load performance concern. Performance Test Selection: |
|



Description
Money Account deposit and withdrawal batches trigger synchronous gas estimation when
addTransactionBatchis called. On networks where gas is sponsored (e.g. Monad Mainnet), a bug in gas estimation can cause a crash when the RPC unexpectedly returnsnullfor the latest block — an error condition we are now handling defensively.This PR passes
skipInitialGasEstimate: trueto deposit and withdrawal batches whenisGasFeeSponsoredis true, deferring gas estimation to the async background path where this error condition is handled safely. Non-sponsored flows are unaffected.Changelog
CHANGELOG entry: Fixed a crash that could occur when initiating Money Account transactions on Monad
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist
Note
Medium Risk
Touches confirmation/transaction submission for Money Account flows; behavior change is gated to sponsored-gas (Monad) chains, with tests updated for withdrawals only.
Overview
Money Account deposit and withdrawal now pass
skipInitialGasEstimate: trueintoaddTransactionBatchwhen the vault chain is Monad Mainnet (same condition asisGasFeeSponsoredviaisMonadMainnetChainId), so synchronous gas estimation is skipped and runs on the async path instead.Deposits also set
isGasFeeSponsoredon the batch (previously only withdrawals did). Withdrawal tests on Monad assert both sponsored flags; non-Monad withdrawal behavior is unchanged aside from not settingskipInitialGasEstimate.Reviewed by Cursor Bugbot for commit 85a41fe. Bugbot is set up for automated code reviews on this repo. Configure here.