fix: HWB197 (24544) fix ledger transaction speedup and cancel#24745
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #24745 +/- ##
=======================================
Coverage 79.82% 79.83%
=======================================
Files 4200 4200
Lines 107434 107454 +20
Branches 22402 22411 +9
=======================================
+ Hits 85761 85786 +25
+ Misses 15652 15648 -4
+ Partials 6021 6020 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…fees. Update `useUnifiedTxActions` to conditionally use legacy gas price or EIP-1559 gas fee based on transaction type. Add tests to verify correct handling of legacy transactions for speed up and cancel actions.
- Implemented tests to ensure that the modal state is properly cleaned up when a user rejects a transaction on the Ledger modal for both speed up and cancel actions. - Updated the `onConfirmation` function to clean up modal state regardless of user confirmation, preventing stale state issues. - Enhanced test coverage for the `useUnifiedTxActions` hook to validate the expected behavior during rejection scenarios.
Updated the gas fee parameter logic in the LedgerTransactionModal to prefer legacyGasFee for legacy transactions and fall back to eip1559GasFee for EIP-1559 transactions. This change simplifies the code and improves clarity. Additionally, updated test descriptions in useUnifiedTxActions.test.ts for better accuracy regarding legacy transaction handling.
…ions Refactored the onSpeedUpCompleted and onCancelCompleted functions to use useCallback for better performance and to prevent unnecessary re-renders. Updated the signLedgerTransaction function to also utilize useCallback, ensuring it correctly references the new completion handlers. This change enhances the efficiency of the transaction handling logic in the UnifiedTransactionsView component.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tag Selection Rationale:
Not Selected:
The risk is medium because:
Performance Test Selection: |
|



Description
This PR fix the ledger transaction speedup and cancel not able to run issue.
The root clause of this issue was caused by when we introduce the new unified transaction view and we forgot to check account is ledger devices or not, and didn't handle ledger differently because ledger require BLE approve to trigger the speed up and cancl transaction.
If you look at legacy behavior defined in
Transaction/index.jsfile which has this code to handle ledger device check and then do speedup and cancelChangelog
CHANGELOG entry: Modify
useUnifiedTxActions.tsto specially handle ledger transaction speed up and cancel transaction.Related issues
Fixes: #24544
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes transaction replacement execution paths and fee parameter wiring for Ledger accounts, which can affect speed up/cancel behavior; coverage is improved with new unit tests but the flow is user-funds-adjacent.
Overview
Fixes unified transaction speed up and cancel for Ledger accounts by detecting Ledger keyring addresses and routing replacement transactions through
LedgerTransactionModal(BLE confirmation) instead of callingspeedUpTransaction/TransactionController.stopTransactiondirectly.Extends Ledger replacement parameters to support legacy
gasPriceaslegacyGasFee(in addition to EIP-1559 fees), passes the appropriate fee shape through the modal, and ensures modal state is cleaned up even when the user rejects on the Ledger confirmation screen. Adds comprehensive unit tests covering Ledger vs non-Ledger paths and legacy vs EIP-1559 fee handling.Written by Cursor Bugbot for commit fe13682. This will update automatically on new commits. Configure here.