Skip to content

feat: merge QR context with hardware wallet context#28807

Open
montelaidev wants to merge 12 commits intomainfrom
feat/mul-1507-part2
Open

feat: merge QR context with hardware wallet context#28807
montelaidev wants to merge 12 commits intomainfrom
feat/mul-1507-part2

Conversation

@montelaidev
Copy link
Copy Markdown
Contributor

@montelaidev montelaidev commented Apr 14, 2026

Description

This PR migrates the qr context into the hardware wallet providers.

Changelog

CHANGELOG entry: QR wallet context is migrated into Hardware wallet context.

Related issues

Related to: https://consensyssoftware.atlassian.net/browse/MUL-1507
Related to: https://consensyssoftware.atlassian.net/browse/MUL-1513
Resolves: https://consensyssoftware.atlassian.net/browse/MUL-1741

Manual testing steps

QR accounts should work like normal.

Feature: qr wallet error

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Touches transaction signing/cancel/speed-up paths and shared hardware-wallet connection UX, so regressions could block hardware-wallet users from completing or rejecting transactions. Changes are well-covered by new/updated unit tests but span multiple critical flows.

Overview
Centralizes hardware-wallet transaction handling by introducing executeHardwareWalletOperation and updating auto-signing + cancel/speed-up flows (in RootRPCMethodsUI, Transactions, and useUnifiedTxActions) to use the shared readiness/awaiting-confirmation + rejection/error behavior instead of bespoke Ledger navigation.

Moves QR signing state into the hardware wallet provider via a new QRSigningContext/useQRSigningState, updates the awaiting-confirmation bottom-sheet content to render QR codes + scanner and to validate/resolve/reject QR signature scans, and extends gas replacement handling with normalizeReplacementGasFeeParams to avoid forwarding incomplete fee params.

Reviewed by Cursor Bugbot for commit 38f885f. Bugbot is set up for automated code reviews on this repo. Configure here.

Add QR signing context and hardware wallet integration, including
new executeHardwareWalletOperation utility, useQRSigningState hook,
and updated connection flow with improved error handling and tests.
@montelaidev montelaidev self-assigned this Apr 14, 2026
@montelaidev montelaidev requested a review from a team as a code owner April 14, 2026 12:51
@montelaidev montelaidev added the team-accounts-framework Accounts team label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot added size-XL risk-high Extensive testing required · High bug introduction risk labels Apr 14, 2026
Comment thread app/core/HardwareWallet/hooks/useQRSigningState.ts
Comment thread app/components/Nav/Main/RootRPCMethodsUI.test.js
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 14, 2026
Comment thread app/components/Nav/Main/RootRPCMethodsUI.test.js
Comment thread app/components/UI/Transactions/index.js
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.27%. Comparing base (aa88381) to head (c83624a).
⚠️ Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
app/components/UI/Transactions/index.js 75.00% 5 Missing ⚠️
app/components/Nav/Main/RootRPCMethodsUI.js 80.00% 3 Missing ⚠️
...ttomSheet/contents/AwaitingConfirmationContent.tsx 96.07% 0 Missing and 2 partials ⚠️
.../core/HardwareWallet/contexts/QRSigningContext.tsx 71.42% 1 Missing and 1 partial ⚠️
...e/HardwareWallet/executeHardwareWalletOperation.ts 96.42% 0 Missing and 1 partial ⚠️
...re/HardwareWallet/hooks/useDeviceConnectionFlow.ts 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #28807      +/-   ##
==========================================
+ Coverage   82.19%   82.27%   +0.08%     
==========================================
  Files        4987     5020      +33     
  Lines      131211   131816     +605     
  Branches    29316    29418     +102     
==========================================
+ Hits       107843   108458     +615     
- Misses      16017    16021       +4     
+ Partials     7351     7337      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gantunesr gantunesr changed the title feat: merge qr context with hardware wallet context feat: merge QR context with hardware wallet context Apr 14, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 15, 2026
Comment thread app/components/UI/Transactions/index.js
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 15, 2026
Comment thread app/components/UI/Transactions/index.js Outdated
Comment thread app/components/UI/Transactions/index.js
@github-actions github-actions Bot removed the risk-high Extensive testing required · High bug introduction risk label Apr 16, 2026
@github-actions github-actions Bot added the risk-high Extensive testing required · High bug introduction risk label Apr 16, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 16, 2026
Comment thread app/components/Nav/Main/RootRPCMethodsUI.js Outdated
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeWalletPlatform
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: high
  • AI Confidence: 82%
click to see 🤖 AI reasoning details

E2E Test Selection:
The PR makes significant changes to the hardware wallet infrastructure, specifically:

  1. Core hardware wallet flow refactoring: The executeHardwareWalletOperation utility replaces direct navigation to LedgerTransactionModal in RootRPCMethodsUI.js, Transactions/index.js, and useUnifiedTxActions.ts. This is a critical path change affecting how hardware wallet transactions are signed.

  2. QR Signing Context: New QRSigningContext and useQRSigningState hook are introduced and provided at the HardwareWalletProvider level. The AwaitingConfirmationContent component now handles QR-specific UI (QR code display, camera scanner, error handling).

  3. SmokeAccounts: This tag covers QR-based hardware wallet account addition and management. The changes to QR signing flow and the new QR context directly affect QR hardware wallet account workflows.

  4. SmokeConfirmations: The auto-sign flow in RootRPCMethodsUI.js is refactored to use executeHardwareWalletOperation. This affects how hardware wallet transactions are confirmed via dApp interactions. Transaction signing (personal_sign, typed data, contract interactions) for hardware wallet accounts goes through this path.

  5. SmokeWalletPlatform: The Transactions/index.js changes affect the transaction history component's speed-up/cancel flows for hardware wallet accounts. The useUnifiedTxActions.ts changes also affect the unified transaction view's hardware wallet signing.

No performance tests are needed as these changes are focused on hardware wallet UI flows and don't affect rendering performance, data loading, or app startup.

Performance Test Selection:
The changes are focused on hardware wallet signing flows, QR context management, and transaction confirmation refactoring. These are not performance-sensitive areas - they don't affect UI rendering performance, data loading, account/network list components, or app startup. No performance tests are warranted.

View GitHub Actions results

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 38f885f. Configure here.

Comment thread app/components/UI/Transactions/index.js
@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
11 value mismatches detected (expected — fixture represents an existing user).
View details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-high Extensive testing required · High bug introduction risk size-XL team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants