fix: hide gas sponsorship badge for hardware wallets in bridge activity details#28584
fix: hide gas sponsorship badge for hardware wallets in bridge activity details#28584dawnseeker8 wants to merge 4 commits intomainfrom
Conversation
…ty details The BridgeTransactionDetails component showed "Paid by MetaMask" for hardware wallet transactions because it checked only evmTxMeta.isGasFeeSponsored without verifying hardware wallet status. When a HW user rejects signing, the flag is never cleared by the confirm callback. Gate the display with an isHardwareAccount check, mirroring the existing pattern in gas-fee-details-row. Fixes #28268
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ 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 3cdc719. Configure here.
app/components/UI/Bridge/components/TransactionDetails/TransactionDetails.test.tsx
Outdated
Show resolved
Hide resolved
…onDetails tests for visibility checks
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: There are no changes to controllers, Engine, network management, onboarding, identity, or multi-chain provider layers. The modification appears UI-scoped to bridge transaction detail rendering and related logic, so the primary risk is regression in bridge execution and confirmation display rather than broader wallet functionality. Therefore:
No other tags are required based on the impacted scope. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |




Description
When a hardware wallet (Ledger/QR) user initiates a swap on MON network and rejects signing on the device, the transaction is marked as failed but the
isGasFeeSponsoredflag on the transaction metadata is never cleared (the confirm callback that clears it only runs on actual confirmation). TheBridgeTransactionDetailscomponent then readsevmTxMeta.isGasFeeSponsoreddirectly and incorrectly displays "Paid by MetaMask" in the gas fee field.This PR adds an
isHardwareAccountcheck inBridgeTransactionDetailsso the "Paid by MetaMask" tag is only shown when the sender is not a hardware wallet. This mirrors the existing pattern used ingas-fee-details-row.tsxwhere gasless support (which excludes HW wallets) is checked before displaying the sponsored fee badge.Changelog
CHANGELOG entry: Fixed a bug where "Paid by MetaMask" was incorrectly shown in transaction details for failed hardware wallet swaps on MON network
Related issues
Fixes: #28268
Manual testing steps
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI-logic change that only gates rendering of the gas sponsorship badge based on
isHardwareAccount, plus focused unit tests; no transaction processing or persistence behavior is modified.Overview
Prevents the "Paid by MetaMask" badge from being shown in
BridgeTransactionDetailswhen the sender (txParams.from) is a hardware wallet by adding anisHardwareAccountcheck before rendering the sponsored-fee tag.Adds unit tests that mock
isHardwareAccountto verify the badge is hidden for sponsored hardware-wallet transactions and still shown for sponsored non-hardware transactions.Reviewed by Cursor Bugbot for commit b2c72b0. Bugbot is set up for automated code reviews on this repo. Configure here.