-
Notifications
You must be signed in to change notification settings - Fork 83
feature: update bdk-cli to use bdk_wallet v1
#174
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
feature: update bdk-cli to use bdk_wallet v1
#174
Conversation
add bdk_wallet to Cargo.toml * the bdk crate is still in using because of the error enum, which will be removed after feedback [Ticket: X]
-update imports from bdk to use bdk_wallet - set `enable_rbf` command option to be `true` by default - add `parse_address` fn to parse address from string - replace `ExtendedPrivateKey` with `Xpriv` from bdk_wallet - update derving address from string to use `assumed_check` [Ticket: X]
- replace `list_transactions` method with `transactions` - format `recipients` to be a vec of `ScriptBuf` and `Amount` - update creating and serializing `Psbt`s - update `fee_rate` method and default to `FeeRate::BROADCAST_MIN` - replace `allow_shrinking` method with `drain_to` method - update `handle_offline_wallet_subcommands` to use `PersistedWallet<D>` instead of `Wallet<D>` [Ticket: X]
- update imports from bdk to bdk_wallet - fix compilation warnings [Ticket: X]
- add `parse_address` method - remove `key-value-db` feature as it uses `sled` - update `open_database` fn to return rusqlite::Connection - update `new_wallet` fn to return `PersistedWallet<Connection>` [Ticket: X]
- Replace `bdk` with `bdk_wallet` v1 in Cargo.toml - replace removed features in bdk features/mods with crates [Ticket: X]
-add error enum for handling errors [Ticket: X]
6653428 to
c7bd335
Compare
- replace bdk::error with custom error enum - update imports and handling of errors [Ticket: X]
c7bd335 to
50233dd
Compare
- update deps imports - refactor reserves feature [Ticket: X]
- replace `bitcoincore_rpc` client with `electrsd::Node` client - update rpc commands - update `electrsd` to v0.31.0 [Ticket: X]
4bf989c to
58f07a1
Compare
-update error enum - update creating a new_backend [Ticket: X]
|
I've been doing some cleanup on your branch, sorry it's squashed all into one commit, see here: https://github.com/notmandatory/bdk-cli/tree/feat/bdk-wallet-v1-update It works for electrum, esplora, sqlite, and repl mode, but not completely tested. I remove rpc and cbf for now, and cleaned up the features so they can all be enabled together, the recommended way for rust. Do you mind if I push my branch into your PR so you can continue working on it to add rpc and cbf back in. It will overwrite your last commit. |
|
I also removed the hwi support and proof of reserves. Both of these still need updating for 1.0 so we can leave them out of this PR. I'd also like to re-think what sort of testing we need, the old tests I commented out. And re-think what we want to do for the github CI. |
I don’t mind; you can go ahead and push. Thank you so much. |
-update all online wallet subcommands [Ticket: X]
- add ci test for features - add "compiler" feature to bdk_wallet dependency - remove duplicate fn in utils.rs - replace "possible_values" with "value_parser" as it is deprecated in clap 4.5 [Ticket: X]
- remove unavailable features in code_coverage workflow - add more features for the cont_integration workflow - update local compilation test script [Ticket: X]
src/commands.rs
Outdated
| // #[cfg(test)] | ||
| // mod test { |
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.
Will all of the tests here ultimately need to be updated in a follow-up PR?
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.
For now, the emphasis is not to test inputs but to test that features are building correctly, which has been included in the ci directory
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.
However, if you notice any outputs that seem incorrect or if you want specific features or sections tested, please indicate them here.
- re-enable `rpc` feature
c163b95 to
b20683a
Compare
-add more error types to error enum - update the handlers file to replace Generic error arm [Ticket: X]
b20683a to
cb10873
Compare
f001a48 to
62ca1c4
Compare
897f7e5 to
2828cee
Compare
2828cee to
efc5fc5
Compare
ff99cbd to
4a66557
Compare
Also when doing an rpc sync, re-sync the prior 200 blocks to handle any possible reorg scenarios.
|
Code looks good but I wasn't able to do a round trip test of receiving and sending back bitcoin to a signet faucet using the new
I was not able to broadcast this signed TX however. I don't know why, I get the error "PsbtError: invalid magic". Were you able to successfully receive and send coins back to a signet or testnet wallet? |
I haven’t tested signing and broadcasting on either signet or testnet yet, as I have primarily been working on regtest. I will test on them now to see the outcome. |
- fix the returned data after signing or finalizing `psbt` [Ticket: X]
The error occurred because the returned PSBT data after signing or finalizing was the original unsigned PSBT instead of the signed PSBT. I have fixed the bug and can now broadcast signed transactions. Apologies for not catching it at my end. |
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 e0bd147
I retested and verified sign and broadcast with rpc is working. Thanks for hanging in there and getting this first big step done!
Description
This PR update
bdk-clito usebdk_walletv1Issue: #172 (comment)
Notes to the reviewers
list_transactionswithtransactionsenable_rbfto betrueby defaultnew_walletto returnPersistedWallet<Connection>zeroizeto version1.8.1from<1.4.0bdk-reservesfrom0.27.1to0.29.0bdk/electrumwithbdk_electrumfor theelectrumfeaturebdk_esplorafor thebdk/use-esplora-ureqandbdk/use-esplora-reqwestfeaturesbdk_bitcoind_rpclib to replacebdk/rpcfeaturehwilibrary to replacebdk/hardware-signerfeatureChangelog notice
enable_rbfto betrueby defaultPartiallySignedTransactiontoPsbtzeroizeto version1.8.1from<1.4.0bdk-reservesfrom0.27.1to0.29.0bdk/electrumwithbdk_electrumfor theelectrumfeaturebdk/use-esplora-ureqandbdk/use-esplora-reqwestwithbdk_esploralibbdk/rpcwithbdk_bitcoind_rpclibbdk/hardware-signerwithhwilibChecklists
All Submissions:
cargo fmtandcargo clippybefore committingBugfixes: