-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore(deps): bump bdk wallet & friends to 1.0.0 #553
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
use argh::FromArgs; | ||
use bdk_wallet::{ | ||
bitcoin::Amount, chain::ChainOracle, descriptor::IntoWalletDescriptor, KeychainKind, Wallet, | ||
bitcoin::Amount, | ||
chain::{ChainOracle, TxUpdate}, | ||
descriptor::IntoWalletDescriptor, | ||
KeychainKind, Update, Wallet, | ||
}; | ||
use console::{style, Term}; | ||
|
||
|
@@ -76,8 +79,17 @@ | |
continue; | ||
} | ||
|
||
// F***! BDK 1.0 removed the `insert_tx` method, so we have to do this the hard way | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an issue filed on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, but as said above we can use Just waiting input from @Zk2u since he did a lot of development as well with BDK in Strata. |
||
// Taken from https://github.com/bitcoindevkit/bdk/pull/1658/commits/3135e291d777d474ab4b76de36d43a96ff104a3c | ||
recovery_wallet.transactions().for_each(|tx| { | ||
l1w.insert_tx(tx.tx_node.tx); | ||
l1w.apply_update(Update { | ||
tx_update: TxUpdate { | ||
txs: vec![tx.tx_node.tx], | ||
..Default::default() | ||
}, | ||
..Default::default() | ||
}) | ||
.expect("could not insert transaction"); | ||
Comment on lines
+82
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any ideas here @Zk2u? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC you can use the |
||
}); | ||
|
||
let recover_to = l1w.reveal_next_address(KeychainKind::External).address; | ||
|
@@ -88,13 +100,12 @@ | |
)); | ||
|
||
// we want to drain the recovery path to the l1 wallet | ||
let mut psbt = recovery_wallet | ||
.build_tx() | ||
.drain_to(recover_to.script_pubkey()) | ||
.fee_rate(fee_rate) | ||
.clone() | ||
.finish() | ||
.expect("valid tx"); | ||
let mut psbt = { | ||
let mut builder = recovery_wallet.build_tx(); | ||
builder.drain_to(recover_to.script_pubkey()); | ||
builder.fee_rate(fee_rate); | ||
builder.finish().expect("valid tx") | ||
}; | ||
|
||
recovery_wallet | ||
.sign(&mut psbt, Default::default()) | ||
|
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.
This is needed now 😓 Cc @Zk2u