Skip to content

feat(hw): add QR signing context and state management hook#29083

Merged
montelaidev merged 1 commit into
mainfrom
feat/mul-1507-split-2-qr-signing
Apr 21, 2026
Merged

feat(hw): add QR signing context and state management hook#29083
montelaidev merged 1 commit into
mainfrom
feat/mul-1507-split-2-qr-signing

Conversation

@montelaidev

@montelaidev montelaidev commented Apr 21, 2026

Copy link
Copy Markdown
Contributor

Description

Adds:

  • QRSigningContext for QR hardware wallet signing state
  • useQRSigningState hook for managing QR scan request lifecycle
  • Index files.

Note: This is currently dead code until

Changelog

CHANGELOG entry: null

Related issues

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

Manual testing steps

This can only be tested via #29087

Screenshots/Recordings

Not applicable

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
Low risk: adds new QR-signing context/hook and tests without modifying existing signing/connection flows; primary risk is incorrect cancellation/completion behavior once wired into navigation.

Overview
Adds a new QRSigningContext (and useQRSigning) to standardize access to pending QR keyring scan requests and related lifecycle actions.

Introduces useQRSigningState, which derives the current pending scan request from Redux, tracks per-request completion state, and provides cancelQRScanRequestIfPresent() to reject an active SIGN request via the QR keyring scanner. Exports the new context/hook via the HardwareWallet contexts/hooks index files and adds unit tests for both the context guard and hook behavior.

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

Add QRSigningContext for QR hardware wallet signing state, useQRSigningState
hook for managing QR scan request lifecycle, and export from index files.
@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-accounts-framework Accounts team label Apr 21, 2026
@github-actions github-actions Bot added size-M risk-low Low testing needed · Low bug introduction risk labels Apr 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

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

E2E Test Selection:
The PR introduces 6 new files (4 production, 2 test) that are purely additive:

  1. QRSigningContext.tsx - New React context for QR signing state management
  2. useQRSigningState.ts - New hook that reads from Redux qrKeyringScanner state and provides QR scan request management
  3. contexts/index.ts - Adds exports for the new context
  4. hooks/index.ts - Adds export for the new hook
  5. Two corresponding test files

Key findings from investigation:

  • No existing production files import useQRSigning, QRSigningContext, or useQRSigningState - these are not yet consumed anywhere
  • The HardwareWalletProvider.tsx (which wraps the entire app via Root/index.tsx) has NOT been modified
  • These changes are purely preparatory/foundational for future QR hardware wallet signing functionality
  • No existing E2E test flows are broken or affected by these additive changes

Why SmokeAccounts: The SmokeAccounts tag explicitly covers "adding QR-based hardware wallet accounts" - this is the feature area these new files are building toward. Running SmokeAccounts validates that the existing QR hardware wallet account flow still works correctly and that these new additions don't inadvertently break anything in the hardware wallet infrastructure.

No performance impact: These are new, unused context/hook files with no rendering or data loading changes to existing components.

Performance Test Selection:
The changes are purely additive new files (context and hook) that are not yet consumed by any production component. There are no changes to rendering, data loading, state management of existing components, or any critical user flows. No performance impact expected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

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

@montelaidev montelaidev enabled auto-merge April 21, 2026 12:04
@montelaidev montelaidev added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 25adb40 Apr 21, 2026
120 checks passed
@montelaidev montelaidev deleted the feat/mul-1507-split-2-qr-signing branch April 21, 2026 21:10
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 21, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.75.0 Issue or pull request that will be included in release 7.75.0 label Apr 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.75.0 Issue or pull request that will be included in release 7.75.0 risk-low Low testing needed · Low bug introduction risk size-M team-accounts-framework Accounts team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants