metamask-mobile
metamask-mobile copied to clipboard
feat: multiple accounts support in ledger
Description
This PR will enable the multiple accounts supports for ledger devices. Following changes has been made in this PR:
- use @metamask/[email protected] to replace old @consensys/[email protected]
- add
LedgerSelectAccountcomponent to allow user select multiple accounts from ledger devices. (screen is similiar to QR code select account screen) - add
remove accountsfor all hardware wallet accounts inAccountActions.tsxfile. - add some metric logging for
remove accountsandconnect accounts - modify the
engine.tscode andledger.tsto allow intialise the new ledger keyring and its middleware and transport object. - Modify the
BlockingActionModelto supportonAnimationCompletedevent so that we can have better smooth model animation than before. (very lagging animation when some heavy operations like import multiple accounts happened in the background)
Related issues
Fixes:
Manual testing steps
Connect Multiple Ledger accounts
- Launch wallet
- Create a new account
- Once on the wallet view, add a new account or hardware wallet
- Add hardware wallet
- Ledger
- Once device is found, click Continue
- Tick the selected Ledger accounts to be imported
- Click Unlock
Forget Multiple Ledger accounts
- Use an existing wallet that has multiple Ledger accounts imported
- Once on the wallet view, add a new account or hardware wallet
- Add hardware wallet
- Ledger
- Once device is found, click 'Continue'
- Click 'Forget this device' button
- User will be returned to account list with all Ledger accounts removed
Forget Individual Ledger Account
- Use an existing wallet that has multiple Ledger accounts imported
- Once on the wallet view, click on the three dots beside the Address section
- Click 'Remove hardware account'
- Click 'Remove'
- User will be returned to account list with the individual Ledger account removed
Forget Individual QR Code Wallet Account
- Use an existing wallet that has multiple QR Code accounts imported
- Once on the wallet view, click on the three dots beside the Address section
- Click 'Remove hardware account'
- Click 'Remove'
- User will be returned to account list with the individual QR Code account removed
Screenshots/Recordings
Before
After
Pre-merge author checklist
- [x] I’ve followed MetaMask Contributor Docs and MetaMask Mobile Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
Pre-merge reviewer checklist
- [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [x] 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.
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
Attention: Patch coverage is 60.28369% with 56 lines in your changes missing coverage. Please review.
Project coverage is 49.78%. Comparing base (
b2cce87) to head (7c77ce1). Report is 9 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #10109 +/- ##
==========================================
+ Coverage 49.67% 49.78% +0.10%
==========================================
Files 1450 1453 +3
Lines 34888 34997 +109
Branches 3950 3968 +18
==========================================
+ Hits 17330 17422 +92
Misses 16456 16456
- Partials 1102 1119 +17
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 449fab396733ebcc44add614461ab41bd636381a Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e6045017-3886-4834-8e99-f92887f5c3fb
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: a710a749883a7f214dd90844df577b4e7c2beaa2 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e2b14473-dda4-49b7-abbb-ddd8db777946
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅
Commit hash: 073260cecfcda427a635efc588716dbef85cd850 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0d70df48-4213-4fcf-9603-908cf5bce2a4
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/@metamask/[email protected] | None | +6 |
7.26 MB | metamaskbot |
| npm/[email protected] | None | +2 |
24.7 kB | ryanzim |
🚮 Removed packages: npm/@consensys/[email protected], npm/@ledgerhq/[email protected]
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: ef50cb922f03c5e5a31f4ff0b31e380862a14bec Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/e5027c93-e01e-4fa3-b515-500b1dd36437
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅
Commit hash: e3e46f9baf0ec084539ee4a5b60200814ce3fd8e Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/50992526-d8d6-42d4-9b5f-09315c8c5c90
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 9982b72bced84ba45aa88d14d9b568329c3af6c3 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1103934e-a395-4d2c-8141-a0f7fcfd7afd
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅
Commit hash: 2276ce7f8e15ba3504c3a857618f409949931719 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c6b59eaa-aacd-4177-acbb-acac8342db20
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Final e2e tests are all green even Bitrise E2E Status display failure. https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c6b59eaa-aacd-4177-acbb-acac8342db20
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: 368de0f427f19528a0f5f7f634adadf76be61a85 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/49117b82-f925-4015-b3d0-21bd5bffb841
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: c355be4f4b8390dd7eb350dd029f089b1c0b329d Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/4e5f48d7-a226-4fca-b1f6-987e5b5804fa
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: fe4d92e4027157610dd9fa88c4478fe9a785a5cb Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0d27c56a-e5f3-4ba6-906e-b1f4fd4dd4b2
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
LGTM! I just left one final comment that was not resolved yet in the previous reviews
hi, @gantunesr i have done the change to AccountSelector component to make onCheck (toggleAccount) optional.
Bitrise
❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌
Commit hash: c1a24b2c2ac04ea02690a271d6e5d9823d17acfd Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/83827214-d37b-4d3d-bf90-a0119c1a913c
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Bitrise
✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅
Commit hash: 90d86ab2970eb86ae20474abc1523437e260b555 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/942d85f4-ec3c-4bab-936f-333db0f572cd
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Flows tested on iPhone 13/iOS 17.5.1 and Samsung S21/Android 14 and screen recordings attached below:-
Connect Multiple Ledger accounts
Forget Multiple Ledger accounts
Forget Individual Ledger Account
Forget Individual QR Code Wallet Account
Final e2e tests has passed
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/942d85f4-ec3c-4bab-936f-333db0f572cd
Bitrise
✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅
Commit hash: df0bd74d77787f392cf737bb4fc9e86f434c5972 Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/219562a6-6f21-4700-afbc-3a0502159d3e
[!NOTE]
- You can kick off another
pr_smoke_e2e_pipelineon Bitrise by removing and re-applying theRun Smoke E2Elabel on the pull request
Quality Gate passed
Issues
3 New issues
0 Accepted issues
Measures
0 Security Hotspots
61.9% Coverage on New Code
0.0% Duplication on New Code
E2e smoke tests pass. https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/92c7ec10-e428-40d5-b64c-41cc42c0c577