fix(confirmations): handle batch predict deposits and quote‑based alerts#25326
fix(confirmations): handle batch predict deposits and quote‑based alerts#25326pedronfigueiredo merged 10 commits intomainfrom
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. |
e385103 to
3d547d5
Compare
app/components/Views/confirmations/hooks/pay/useTransactionPayToken.ts
Outdated
Show resolved
Hide resolved
1d211a9 to
ad4e985
Compare
app/components/Views/confirmations/hooks/alerts/useInsufficientBalanceAlert.test.ts
Outdated
Show resolved
Hide resolved
ad4e985 to
6d3dbbc
Compare
| !transactionMetadata || | ||
| isTransactionValueUpdating || | ||
| (payToken && !isPayTokenTarget) | ||
| (payToken && !isPayTokenTarget && !isUsingPay) |
There was a problem hiding this comment.
Sorry for the confusion.
The goal here is to skip this alert if we're using MetaMask Pay with a quote.
So we'd want to return if isUsingPay is true.
And we shouldn't need payToken && !isPayTokenTarget since isUsingPay will only be true if there is a pay token, and the controller decided a quote is needed so generated a source amount.
| (!isGasFeeTokensEmpty && !selectedGasFeeToken)); | ||
|
|
||
| const showAlert = | ||
| !shouldSkipInsufficientBalanceForPayToken && |
There was a problem hiding this comment.
These changes shouldn't be needed as we can early return above with no alerts if isUsingPay.
…selection Use hasTransactionType so batch transactions containing predict/perps deposits are recognized when a payment token is selected. This keeps predict gasless selection working while leaving perps behavior unchanged.
Update selectedGasFeeToken for perps deposit transactions when the payment token matches the required token, so gasless relay can proceed without native ETH.
This reverts commit b8c2ac181a11300e992d8749edab921d9190cb43.
6d3dbbc to
567382e
Compare
Tested scenarios:Perps
Predict
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|



Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes blocking alert behavior and updates how
selectedGasFeeTokenis set during pay-token selection forpredictDeposit, which could impact confirmation gating and gas/token selection in edge cases.Overview
Confirmation alerts now defer to transaction-pay UI when pay quotes/source amounts are in play.
useInsufficientBalanceAlertstops emitting the native insufficient-balance blocking alert wheneveruseTransactionPayHasSourceAmount()indicates pay source amounts are being used, replacing the prior pay-token/required-token matching logic.Pay-token selection for
predictDepositis more robust.useTransactionPayTokenuseshasTransactionTypeto detectpredictDeposit(covering nested/batch transactions) and only updatesselectedGasFeeTokenwhentransactionMetais present, with tighter typing.Tests for
useInsufficientBalanceAlertwere updated to mockuseTransactionPayHasSourceAmountand cover the new suppression behavior.Written by Cursor Bugbot for commit 567382e. This will update automatically on new commits. Configure here.