fix(bdk): remove rand dependency

This commit is contained in:
rustaceanrob
2024-04-02 14:31:18 -10:00
committed by Rob N
parent 0543801787
commit 45c0cae0a4
20 changed files with 412 additions and 297 deletions

View File

@@ -11,3 +11,4 @@ bdk_wallet = { path = "../../crates/wallet" }
bdk_esplora = { path = "../../crates/esplora", features = ["blocking"] }
bdk_file_store = { path = "../../crates/file_store" }
anyhow = "1"
rand = "0.8.0"

View File

@@ -11,6 +11,7 @@ use bdk_wallet::{
bitcoin::{Address, Amount, Network},
KeychainKind, SignOptions, Wallet,
};
use rand::thread_rng;
fn main() -> Result<(), anyhow::Error> {
let db_path = std::env::temp_dir().join("bdk-esplora-example");
@@ -80,7 +81,7 @@ fn main() -> Result<(), anyhow::Error> {
.add_recipient(faucet_address.script_pubkey(), SEND_AMOUNT)
.enable_rbf();
let mut psbt = tx_builder.finish()?;
let mut psbt = tx_builder.finish_with_aux_rand(&mut thread_rng())?;
let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
assert!(finalized);