Skip to content

feat: enable Ledger integration#8246

Merged
dawnseeker8 merged 34 commits into
mainfrom
feat/reenable-ledger-feature
Feb 7, 2024
Merged

feat: enable Ledger integration#8246
dawnseeker8 merged 34 commits into
mainfrom
feat/reenable-ledger-feature

Conversation

@dawnseeker8

@dawnseeker8 dawnseeker8 commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

Description

Previous PR have removed ledger features and its dependancies in main branch, this PR will re-enable thee ledger feature in those modify files.

Related issues

Fixes:

Manual testing steps

  1. In Connect a hareware wallet screen, tap Select a hardware wallet you'd like to use label 7 times to enable ledger feature.
  2. tap ledger icon to enable bluetooth to import account from ledger
  3. Go to metamask test-dapp to test most of functions still work fine with ledger account.

Screenshots/Recordings

  • Connect a hareware wallet screen.
Screenshot 2024-01-11 at 13 23 55
  • account dropdown list:
Screenshot 2024-01-11 at 13 27 09
  • transation
Screenshot 2024-01-11 at 13 28 10
  • personal sign
Screenshot 2024-01-11 at 13 30 27

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

Also fix the code issue in ledger.ts file.
@github-actions

github-actions Bot commented Jan 11, 2024

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.

@codecov-commenter

codecov-commenter commented Jan 11, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 40 lines in your changes are missing coverage. Please review.

Comparison is base (b0fbb66) 40.80% compared to head (e76150a) 40.90%.

Files Patch % Lines
...nts/Views/ConnectHardware/SelectHardware/index.tsx 28.57% 10 Missing ⚠️
app/components/hooks/Ledger/useBluetoothDevices.ts 0.00% 10 Missing ⚠️
app/components/hooks/Ledger/useBluetooth.ts 20.00% 8 Missing ⚠️
app/components/Nav/Main/RootRPCMethodsUI.js 0.00% 5 Missing ⚠️
app/components/Views/LedgerConnect/index.tsx 0.00% 4 Missing ⚠️
...onents/UI/LedgerModals/LedgerConfirmationModal.tsx 0.00% 1 Missing ⚠️
app/components/hooks/Ledger/useLedgerBluetooth.ts 0.00% 1 Missing ⚠️
app/core/Vault.js 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8246      +/-   ##
==========================================
+ Coverage   40.80%   40.90%   +0.10%     
==========================================
  Files        1245     1245              
  Lines       30119    30148      +29     
  Branches     2889     2894       +5     
==========================================
+ Hits        12289    12333      +44     
+ Misses      17127    17112      -15     
  Partials      703      703              

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

@github-actions

Copy link
Copy Markdown
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/135bbe62-765c-49e8-a3f9-4f1387609db1
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@socket-security

socket-security Bot commented Jan 11, 2024

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Jan 11, 2024

Copy link
Copy Markdown

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@expo/json-file@8.2.37

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@gantunesr gantunesr changed the title feat: Reenable Ledger feature by revert previous PR code. feat: enable Ledger integration Jan 23, 2024
Comment thread app/core/Ledger/Ledger.ts Outdated
Comment thread app/core/Ledger/Ledger.ts Outdated
Comment thread app/core/Ledger/Ledger.ts
Comment thread app/core/Ledger/Ledger.ts
Comment thread app/core/Ledger/Ledger.ts Outdated
Comment thread app/core/Vault.js Outdated
Comment thread app/core/Ledger/Ledger.ts Outdated
Comment thread app/core/Ledger/Ledger.ts
Comment thread app/core/Ledger/Ledger.ts
@gantunesr gantunesr marked this pull request as ready for review January 27, 2024 00:12
@gantunesr gantunesr requested a review from a team as a code owner January 27, 2024 00:12
@github-actions

Copy link
Copy Markdown
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/35d650cc-e2e4-4395-8866-1f8db01d7d09
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

@gantunesr gantunesr added the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jan 27, 2024
gantunesr
gantunesr previously approved these changes Feb 6, 2024

@gantunesr gantunesr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Left a small nit comment

Comment thread app/core/Ledger/Ledger.ts
mikesposito
mikesposito previously approved these changes Feb 6, 2024

@mikesposito mikesposito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@github-actions

github-actions Bot commented Feb 6, 2024

Copy link
Copy Markdown
Contributor

E2E test started on Bitrise: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c469a6f2-9170-4188-8275-9a6c6f8e2aed
You can also kick off another Bitrise E2E smoke test by removing and re-applying the (Run Smoke E2E) label

gantunesr
gantunesr previously approved these changes Feb 6, 2024

@gantunesr gantunesr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm!

@gantunesr

Copy link
Copy Markdown
Member

@SocketSecurity ignore npm/@expo/json-file@8.2.37

@gantunesr

Copy link
Copy Markdown
Member

Screenshot 2024-02-06 at 09 41 43

The new publisher is part of the maintainers.

@vivek-consensys

Copy link
Copy Markdown
Contributor

QA passed on Android and iOS using QA build:- https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c3c20b4c-eb95-4a9a-979e-ad62f01fe2b1

Test flows include:-

  • Connect Ledger
  • Disconnect Ledger
  • Send transaction using Ledger
  • Sign typed data v4 using Ledger
  • Sign permit using Ledger
  • SIWE using Ledger
  • Swap using Ledger

@vivek-consensys vivek-consensys added QA Passed QA testing has been completed and passed and removed needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Feb 6, 2024
@dawnseeker8 dawnseeker8 dismissed stale reviews from gantunesr and mikesposito via e76150a February 7, 2024 01:41
@sonarqubecloud

sonarqubecloud Bot commented Feb 7, 2024

Copy link
Copy Markdown

@dawnseeker8

Copy link
Copy Markdown
Contributor Author

Latest e2e pipeline result from bitrise, and they all passed.

  1. e2e smoke tests: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a9090a22-01bc-4b30-aed4-06b7db39a021
  2. regression e2e pipeline: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/c14876a1-6cbf-4da1-9628-1f54bacd858a

@dawnseeker8 dawnseeker8 merged commit d2e5846 into main Feb 7, 2024
@dawnseeker8 dawnseeker8 deleted the feat/reenable-ledger-feature branch February 7, 2024 11:36
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 7, 2024
@metamaskbot metamaskbot added the release-7.17.0 Issue or pull request that will be included in release 7.17.0 label Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ledger-story QA Passed QA testing has been completed and passed release-7.17.0 Issue or pull request that will be included in release 7.17.0 team-hardware-wallets-deprecated DEPRECATED: please use "team-accounts-framework" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants