Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before transaction validate if ledger device still derives same account #1614

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Aug 25, 2023

This improves the error message for users mixing up multiple ledger devices.

E.g.:

  • user has two ledgers with different mnemonics
  • imports account1 from ledger1 and saves it
  • later
  • plugs in ledger2 and tries to transfer from saved account1
  • see error:
Before After
Screenshot from 2023-08-26 00-46-45 Screenshot from 2023-08-26 00-46-50

@lukaw3d lukaw3d requested review from buberdds and lubej August 25, 2023 23:00
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Aug 25, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: d182bfd
Status: ✅  Deploy successful!
Preview URL: https://d8da394c.oasis-wallet.pages.dev
Branch Preview URL: https://lw-wrong-ledger.oasis-wallet.pages.dev

View logs

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 5 0 0.05s
✅ JSON eslint-plugin-jsonc 1 0 0 1.07s
✅ JSON jsonlint 1 0 0.31s
✅ JSON npm-package-json-lint yes no 0.81s
✅ JSON prettier 1 0 0 0.53s
✅ JSON v8r 1 0 2.48s
✅ REPOSITORY checkov yes no 41.75s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 17.22s
✅ REPOSITORY trivy-sbom yes no 2.47s
✅ REPOSITORY trufflehog yes no 157.39s
✅ TSX eslint 1 0 0 5.59s
✅ TYPESCRIPT eslint 3 0 0 6.25s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link
Member

@tjanez tjanez left a comment

Choose a reason for hiding this comment

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

Otherwise looks good, great UX improvement!

@@ -135,6 +135,7 @@
"reclaimedAmount": "Amount to reclaim"
},
"errors": {
"LedgerDerivedDifferentAccount": "This Ledger did not derive this account.",
Copy link
Member

Choose a reason for hiding this comment

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

In terms of the copy, would something like this be even clearer and easier to understand?

This account does not belong to the currently connected Ledger.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1

@lukaw3d lukaw3d force-pushed the lw/wrong-ledger branch 2 times, most recently from a642607 to 8bec3a7 Compare August 28, 2023 16:41
This improves the error message for users mixing up multiple ledger devices.
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #1614 (d182bfd) into master (18faf5c) will decrease coverage by 0.11%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1614      +/-   ##
==========================================
- Coverage   82.96%   82.86%   -0.11%     
==========================================
  Files         157      157              
  Lines        4075     4085      +10     
  Branches      730      731       +1     
==========================================
+ Hits         3381     3385       +4     
- Misses        694      700       +6     
Flag Coverage Δ
cypress 51.04% <0.00%> (-0.15%) ⬇️
jest 77.89% <90.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/app/components/ErrorFormatter/index.tsx 100.00% <ø> (ø)
src/app/lib/ledger.ts 95.52% <80.00%> (-2.76%) ⬇️
src/types/errors.ts 82.35% <100.00%> (+0.53%) ⬆️

... and 2 files with indirect coverage changes

@lukaw3d lukaw3d merged commit 30c8e6d into master Aug 28, 2023
12 of 13 checks passed
@lukaw3d lukaw3d deleted the lw/wrong-ledger branch August 28, 2023 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants