From cdf05f1df4daf1fd99953776e7ac700e07702239 Mon Sep 17 00:00:00 2001 From: rajarshimaitra Date: Thu, 26 Aug 2021 15:03:28 +0530 Subject: [PATCH] Update BDK dependency to v0.10.0 Updating the BDK version creates some breaking change. One of such change probably requires modification of BDK to expose a new function to fetch scriptpubkey from a txid. Used ureq version of esplora to remove async related complexities. --- Cargo.toml | 4 ++-- src/lib.rs | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8595a3f..53f9377 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" license = "MIT" [dependencies] -bdk = { version = "^0.7", default-features = false, features = ["all-keys"]} +bdk = { version = "0.10.0", default-features = false, features = ["all-keys"]} bdk-macros = "^0.4" structopt = "^0.3" serde_json = { version = "^1.0" } @@ -32,7 +32,7 @@ default = ["cli", "repl"] cli = ["bdk/key-value-db", "clap", "dirs-next", "env_logger"] repl = ["regex", "rustyline"] electrum = ["bdk/electrum"] -esplora = ["bdk/esplora"] +esplora = ["bdk/use-esplora-ureq"] compiler = ["bdk/compiler"] async-interface = ["bdk/async-interface"] compact_filters = ["bdk/compact_filters"] diff --git a/src/lib.rs b/src/lib.rs index ac8d6dd..1aa1110 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -736,9 +736,7 @@ where let mut tx_builder = wallet.build_tx(); if send_all { - tx_builder - .drain_wallet() - .set_single_recipient(recipients[0].0.clone()); + tx_builder.drain_wallet().drain_to(recipients[0].0.clone()); } else { tx_builder.set_recipients(recipients); } @@ -797,7 +795,8 @@ where tx_builder.fee_rate(FeeRate::from_sat_per_vb(fee_rate)); if send_all { - tx_builder.maintain_single_recipient()?; + // TODO: Find a way to get the recipient scriptpubkey to allow shrinking + //tx_builder.allow_shrinking() } if offline_signer { -- 2.49.0