-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
R4R: Load Ledger Device at Runtime #2167
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2167 +/- ##
==========================================
- Coverage 63.91% 63.9% -0.02%
==========================================
Files 134 134
Lines 8194 8194
==========================================
- Hits 5237 5236 -1
- Misses 2604 2606 +2
+ Partials 353 352 -1 |
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.
utACK
crypto/ledger_secp256k1.go
Outdated
err = ledgerDeviceErr | ||
var ledgerDevice LedgerSECP256K1 | ||
|
||
if discoverLedger != nil { |
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.
nit why not do
discoverLedger == nil{
return error
}
proceed with normal case
just to avoid the extra indent there.
crypto/ledger_secp256k1.go
Outdated
) | ||
|
||
type ( | ||
// discoverLedgerFn defines a Ledger discovery function that returns a | ||
// connected device or an error upon failure. |
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.
Can you comment that the reason its written as a separate type is to avoid the CGO dependency when the build flag isn't present? (As opposed to having a static function with a boolean for "isPresent")
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 think we can cache the result of ledger.FindLedger()
- unless that caused problems in your testing?
@ValarDragon -- address your comments. Thanks! @cwgoes -- yes, I intentionally avoided the cache for UX reasons, so when using the LCD, you can exit the app or even disconnect and still have it work upon re-opening/connecting. I can add the cache if you think this should be addressed in another PR or avoided all together. |
I don't think the two are mutually exclusive - just try to refresh the cache if the device isn't valid? This isn't a big deal though. |
Agreed @cwgoes -- for another PR then. |
Great! Will test tomorrow. :) |
closes: #2064
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerFor Admin Use: