From: Steve Myers Date: Wed, 30 Mar 2022 00:17:43 +0000 (-0700) Subject: Update sync and broadcast sub-commands for bdk 0.17 X-Git-Tag: v0.5.0~8^2~4 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/enum.FromScriptError.html?a=commitdiff_plain;h=735be18b33c59ba6a242ab56b65ac2e7e0cc398c;p=bdk-cli Update sync and broadcast sub-commands for bdk 0.17 --- diff --git a/src/lib.rs b/src/lib.rs index c1a1a0f..b812251 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -800,11 +800,7 @@ blockchain client and network connection. ))] pub enum OnlineWalletSubCommand { /// Syncs with the chosen blockchain server - Sync { - /// max addresses to consider - #[structopt(short = "v", long = "max_addresses")] - max_addresses: Option, - }, + Sync, /// Broadcasts a transaction to the network. Takes either a raw transaction or a PSBT to extract Broadcast { /// Sets the PSBT to sign @@ -1094,12 +1090,11 @@ where use bdk::SyncOptions; match online_subcommand { - Sync { max_addresses } => { + Sync => { maybe_await!(wallet.sync( blockchain, SyncOptions { progress: Some(Box::new(log_progress())), - max_addresses, } ))?; Ok(json!({})) @@ -1115,8 +1110,8 @@ where (Some(_), Some(_)) => panic!("Both `psbt` and `tx` options not allowed"), (None, None) => panic!("Missing `psbt` and `tx` option"), }; - let txid = maybe_await!(blockchain.broadcast(&tx))?; - Ok(json!({ "txid": txid })) + maybe_await!(blockchain.broadcast(&tx))?; + Ok(json!({ "txid": tx.txid() })) } #[cfg(feature = "reserves")] ProduceProof { msg } => {