-
Notifications
You must be signed in to change notification settings - Fork 115
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
go/common/crypto/signature/signers/ledger: Descriptive error on user reject #3050
Conversation
a92a699
to
639a1b5
Compare
return s.device.SignEd25519(s.path, preparedContext, message) | ||
signature, err := s.device.SignEd25519(s.path, preparedContext, message) | ||
if err != nil { | ||
if err.Error() == ledgerRejectTxErrorMsg { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use errors.Is
instead. Also consider using a switch statement instead of these nested ifs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed nested ifs and used a switch statement.
I couldn't use errors.Is()
because at the moment, ledger-go doesn't use proper Go error semantics and doesn't expose errors as variables.
Codecov Report
@@ Coverage Diff @@
## master #3050 +/- ##
==========================================
- Coverage 68.27% 68.23% -0.04%
==========================================
Files 372 372
Lines 36437 36444 +7
==========================================
- Hits 24877 24868 -9
- Misses 8346 8365 +19
+ Partials 3214 3211 -3
Continue to review full report at Codecov.
|
639a1b5
to
a0b89d7
Compare
Make Ledger signer return a more descriptive error message when a user rejects a transaction on the Ledger device.
a0b89d7
to
bb7fbe7
Compare
Make Ledger signer return a more descriptive error message when a user rejects a transaction on the Ledger device.
For example, previously, the returned error was:
Now, it is: