-
Notifications
You must be signed in to change notification settings - Fork 330
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
Add a custom signer for hardware wallets #682
Conversation
This is exciting that I'm wondering whether "Hardware Wallet" is the best name since we have a struct named |
Now that you say it, it makes sense. This isn't anywhere close to the |
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.
Sorry for the early review, I was just too excited to leave this PR alone 😁
This is looking great! I'd split this in multiple commits, at least once for the actual code and one for the CI.
1d99858
to
3e5ea35
Compare
8cd2442
to
41c8d95
Compare
41c8d95
to
432c3ed
Compare
src/hardwaresigner/mod.rs
Outdated
} | ||
|
||
#[test] | ||
fn test_create_signer() { |
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.
In BDK we have two different types of tests:
- unit tests
- integration tests, which use blockchain backends
This should probably be a unit test, and should have the same structure as the other ones. See, for example, test_sign_single_xprv
in src/wallet/mod.rs
: there's no blockchain backend being created, only the transaction creation/signing part is tested. This test should also probably be moved in src/wallet/mod.rs
.
Then, integration tests could be useful as well. To write one, you should modify the bdk_blockchain_tests
in src/testutils/blockchain_tests.rs
. Those tests will be run against every backend we support.
9a859bd
to
a114eeb
Compare
I've just published hwi 0.2.1 btw :) |
Btw, I don't like that much having the hw module under src/hardwaresigner, it feels out of place... I'd say it should be either in src/wallet/signer.rs, or maybe you could make signer.rs a module and put the hardwaresigner in src/wallet/signer/hardwaresigner.rs, as you wish |
e271984
to
60103e8
Compare
d1763b3
to
3174208
Compare
3174208
to
1dcfa50
Compare
1dae8bd
to
6f1d8d1
Compare
6f1d8d1
to
2860c41
Compare
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
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.
Review ACK.. This is really exciting.. Very much pumped for BDK HWI integration. Thanks for working on this.. Below I have few comments..
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.
tACK 2860c41
2860c41
to
a5d4eda
Compare
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.
Thanks for the quick update.. Few more comments..
6561592
to
ab9711b
Compare
872d374
to
86c1a75
Compare
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.
ACK 86c1a75 - thanks for taking care of this!
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.
tACK 86c1a75
Also add function to get funded wallet with coinbase
86c1a75
to
138acc3
Compare
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.
ACK 138acc3
Also adds a new test in CI for building and testing on a virtual
hardware wallet.
Description
This PR would enable BDK users to sign transactions using a hardware wallet. It is just the beginning hence there are no complex features, but I hope not for long.
I have added a test in CI for building a ledger emulator and running the new test on it. The test is similar to the one on bitcoindevkit/rust-hwi.
Notes to the reviewers
The PR is incomplete (and wouldn't work, as the rust-hwi in
cargo.toml
is pointing to a local crate, temporarily) as a small change is required in rust-hwi (bitcoindevkit/rust-hwi#42).Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md