Skip to content

Commit

Permalink
Qualifying LockTime as absolute::LockTime
Browse files Browse the repository at this point in the history
  • Loading branch information
futurechimp committed Aug 17, 2024
1 parent c256fd0 commit b7134d1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/wallet/examples/descriptor_with_plan.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::BTreeMap;
use std::str::FromStr;

use bdk_wallet::bitcoin::absolute::LockTime;
use bdk_wallet::bitcoin::bip32::Xpriv;
use bdk_wallet::bitcoin::hashes::Hash;
use bdk_wallet::bitcoin::key::Secp256k1;
Expand Down Expand Up @@ -218,7 +217,7 @@ fn main() {
// plan, sign a new spending psbt, and finalize it.

// Build a spend transaction the unvault key path
let timelock = LockTime::from_height(after).expect("couldn't format locktime");
let timelock = absolute::LockTime::from_height(after).expect("couldn't format locktime");
let unvault_spend_transaction = blank_transaction_with(timelock);
let mut psbt = psbt_with_unsigned_tx(unvault_spend_transaction);

Expand All @@ -244,7 +243,7 @@ fn main() {
// Let's try using the Plan module, this time with two assets: the unvault_key
// and our `after` timelock.
let unvault_key_asset = DescriptorPublicKey::from_str(unvault_pk).unwrap();
let timelock = LockTime::from_height(after).expect("couldn't format locktime");
let timelock = absolute::LockTime::from_height(after).expect("couldn't format locktime");
let unvault_assets = Assets::new().add(unvault_key_asset).after(timelock);

// Automatically generate a plan for spending the descriptor, using the assets in our plan
Expand Down

0 comments on commit b7134d1

Please sign in to comment.