Commit e085b42
refactor: use
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
dependent on:
- ~~MetaMask/accounts#60
- ~~MetaMask/core#6031
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR uses the `@metamask/eth-qr-keyring` package to handle QR code
keyring functionality, replacing the previous implementation from
`@keystonehq/metamask-airgapped-keyring`.
The change should be transparent to users, as the package is a drop-in
replacement. Though, under the hood, it allows to greatly simplify code
related to QRKeyring-related scanning and signing, and should improve
the overall ergonomics of interactions with QRKeyring.
Moreover, this PR adds the first e2e tests for QR code hardware wallets,
covering:
- Pairing a QR code hardware wallet
- Adding multiple accounts from the QR code hardware wallet
[](https://codespaces.new/MetaMask/metamask-extension/pull/33893?quickstart=1)
## **Related issues**
Fixes:
## **Manual testing steps**
### **Does it work with new HW devices?**
1. Checkout to this branch, and run `yarn && yarn webpack` or `yarn &&
yarn start` to build the extension.
2. Install the extension in your browser, and pair a QR-based hardware
wallet (e.g. a Keystone device, or install AirGap Vault or imToken on an
iOS/Android device).
3. Add some (3) accounts to the QRKeyring, and ensure that you can see
them in the extension.
4. Go to `https://metamask.github.io/test-dapp/`, connect to the
extension.
5. Ensure that you can:
- Sign transactions
- Sign typed data
- Sign personal messages
6. Remove one QR account
7. Forget the QR device
### **Does it work with HW devices already paired?**
1. Checkout to main, and run `yarn && yarn webpack` or `yarn && yarn
start` to build the extension.
2. Install the extension in your browser, and pair a QR-based hardware
wallet (e.g. a Keystone device, or install AirGap Vault on an
iOS/Android device).
3. Add some (3) accounts to the QRKeyring, and ensure that you can see
them in the extension.
4. Checkout to this branch, and run `yarn && yarn webpack` or `yarn &&
yarn start` to build the extension.
5. Go to `chrome://extensions/`, and reload the extension.
6. Login to the extension, and ensure that you can see the same accounts
as before.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
---------
Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>@metamask/eth-qr-keyring (#33893)1 parent 0f8ce54 commit e085b42
33 files changed
Lines changed: 674 additions & 683 deletions
File tree
- .storybook
- .yarn/patches
- app/scripts
- constants
- controllers
- lib
- lavamoat/browserify
- beta
- experimental
- flask
- main
- test
- e2e
- page-objects/pages/hardware-wallet
- tests
- hardware-wallets
- metrics/state-snapshots
- integration/data
- stub
- ui
- __mocks__
- components/app/qr-hardware-popover
- qr-hardware-sign-request
- qr-hardware-wallet-importer
- selectors
- store
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
| |||
Lines changed: 0 additions & 60 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
637 | 640 | | |
638 | 641 | | |
639 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
696 | 695 | | |
697 | 696 | | |
698 | 697 | | |
699 | | - | |
700 | | - | |
701 | | - | |
| 698 | + | |
702 | 699 | | |
703 | 700 | | |
704 | 701 | | |
| |||
717 | 714 | | |
718 | 715 | | |
719 | 716 | | |
720 | | - | |
721 | | - | |
722 | | - | |
| 717 | + | |
723 | 718 | | |
724 | 719 | | |
725 | 720 | | |
| |||
728 | 723 | | |
729 | 724 | | |
730 | 725 | | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
| 726 | + | |
735 | 727 | | |
736 | 728 | | |
737 | 729 | | |
| |||
0 commit comments