fix: tempo useHasInsufficientBalance return false non-7702 cp-13.27.0#41721
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (2 files, +67 -7)
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f8e83ca. Configure here.
Builds ready [f8e83ca]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs
|
f8e83ca to
603c491
Compare
Builds ready [603c491]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
603c491 to
71875bd
Compare
71875bd to
eba87a4
Compare
Builds ready [eba87a4]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [fe6aa2c]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 12 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Ran non-reg for non-hardware-wallets: Non-Reg Test Summary
✅ Tempo TX → OK (pathUSD)
✅ Tempo TX → OK
✅ Tempo TX → OK |




When signing a tx on Tempo:
0, since we using a 7702 gasless flow, this has only positive impact on UX.0throwing an error.The issue is that some hardware wallet users may have already interacted with Tempo before the recent changes. On the current Extension release, those users may not be able to transact on Tempo anymore, making it a regression.
This PR introduces a quick fix, strictly scoped to Hardware Wallets on Tempo chains so it doesn't affect other flows. It modifies
useHasInsufficientBalancehook to override balance checks on Tempo, and instead do:Description
Changelog
CHANGELOG entry: useHasInsufficientBalance to skip native balance checks on Tempo
Related issues
Fixes:
Manual testing steps
Use Extension on Tempo using an Hardware Wallet.
Transactions should be optimistic, showing an estimate of
pathUSDgas fees, regardless of userpathUSDbalance.Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Introduces chain-specific branching in
useHasInsufficientBalancefor Tempo networks, which can affect transaction confirmation gating on those chains if theexcludeNativeTokenForFeeflag is set incorrectly.Overview
Adjusts
useHasInsufficientBalanceto special-case Tempo mainnet/testnet (0x1079,0xa5bf) by bypassing the normal native balance + max-fee sufficiency check when the chain has no native asset.For these chains, the hook now returns insufficient balance only when
excludeNativeTokenForFeeistrue(gasless/7702), and returns sufficient balance when the flag is unset (legacy/hardware-wallet flow). Tests are updated to cover these behaviors and the Jest console baseline is updated accordingly.Reviewed by Cursor Bugbot for commit fe6aa2c. Bugbot is set up for automated code reviews on this repo. Configure here.