Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Add Ledger error codes #10056

Merged
merged 4 commits into from
May 15, 2020

Conversation

CriesofCarrots
Copy link
Contributor

Problem

The ledger-solana-app throws a number of exception codes that aren't recognized by the solana ledger.rs module, and all get translated to RemoteWalletError::Protocol("Unknown error").

Summary of Changes

  • Add a LedgerError enum to map error codes to descriptive rust errors, and parse apdu status on read.
  • Also fixup wallet_manager initialization to return a device error, if there is such, when no devices can be read successfully

@CriesofCarrots CriesofCarrots requested a review from t-nelson May 15, 2020 03:05
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

Looks like I need to hunt up a couple of these that weren't explicitly THROW()n 🤔

This side looks good to me though!

@CriesofCarrots
Copy link
Contributor Author

@garious , would you like this on v1.1?

@garious
Copy link
Contributor

garious commented May 15, 2020

Yes, please

@CriesofCarrots CriesofCarrots added v1.1 automerge Merge this Pull Request automatically once CI passes labels May 15, 2020
@solana-grimes solana-grimes merged commit 63813fe into solana-labs:master May 15, 2020
@codecov
Copy link

codecov bot commented May 15, 2020

Codecov Report

Merging #10056 into master will decrease coverage by 0.0%.
The diff coverage is 21.5%.

@@            Coverage Diff            @@
##           master   #10056     +/-   ##
=========================================
- Coverage    80.5%    80.5%   -0.1%     
=========================================
  Files         295      296      +1     
  Lines       68157    68201     +44     
=========================================
+ Hits        54928    54931      +3     
- Misses      13229    13270     +41     

mergify bot pushed a commit that referenced this pull request May 15, 2020
automerge

(cherry picked from commit 63813fe)
solana-grimes pushed a commit that referenced this pull request May 15, 2020
@CriesofCarrots CriesofCarrots deleted the ledger-error-codes branch May 26, 2020 23:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants