From bfc0deb4a42fdf694613d85066b5cb8786b9fc6b Mon Sep 17 00:00:00 2001 From: Jose Storopoli Date: Thu, 19 Dec 2024 17:21:25 -0300 Subject: [PATCH] chore(deps): bump bdk wallet & friends to 1.0.0 --- Cargo.lock | 306 ++---------------------- Cargo.toml | 7 + bin/strata-cli/Cargo.toml | 9 +- bin/strata-cli/src/cmd/deposit.rs | 17 +- bin/strata-cli/src/cmd/drain.rs | 15 +- bin/strata-cli/src/cmd/recover.rs | 29 ++- bin/strata-cli/src/cmd/send.rs | 13 +- bin/strata-cli/src/signet/backend.rs | 6 +- crates/util/python-utils/Cargo.toml | 5 +- crates/util/python-utils/src/drt.rs | 47 ++-- crates/util/python-utils/src/taproot.rs | 15 +- 11 files changed, 108 insertions(+), 361 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7a3c13b0..dfde4c73d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -88,12 +88,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ahash" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0453232ace82dee0dd0b4c87a59bd90f7b53b314f3e0f61fe2ee7c8a16482289" - [[package]] name = "ahash" version = "0.8.11" @@ -1582,29 +1576,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-compression" version = "0.4.11" @@ -1621,90 +1592,6 @@ dependencies = [ "zstd-safe 7.2.0", ] -[[package]] -name = "async-executor" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.3.1", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", -] - -[[package]] -name = "async-io" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" -dependencies = [ - "async-lock", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-std" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers 0.3.0", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -1727,12 +1614,6 @@ dependencies = [ "syn 2.0.86", ] -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.81" @@ -1917,9 +1798,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bdk_bitcoind_rpc" -version = "0.16.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "577233392985869b7b5d9e0eae638c5112c48d5edc07422de0e0726c15144e92" +checksum = "2ac1a1da33a22949c3e2b3a715431eaed50c2c9278c8cdac06f0254b7659291f" dependencies = [ "bdk_core", "bitcoin", @@ -1928,34 +1809,33 @@ dependencies = [ [[package]] name = "bdk_chain" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bee1fe68ec0015bce2e4c1754ebbf18d70750a1f0103e3785d34e8959fe8fd7" +checksum = "4955734f97b2baed3f36d16ae7c203fdde31ae85391ac44ee3cbcaf0886db5ce" dependencies = [ "bdk_core", "bitcoin", "miniscript", "rusqlite", "serde", - "serde_json", ] [[package]] name = "bdk_core" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e187ee33d5f99f1997a700cc1dfa0524fd1de31e6414c612c9e89ccdaa133" +checksum = "b545aea1efc090e4f71f1dd5468090d9f54c3de48002064c04895ef811fbe0b2" dependencies = [ "bitcoin", - "hashbrown 0.9.1", + "hashbrown 0.14.5", "serde", ] [[package]] name = "bdk_esplora" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcae78230aedb46d07f7fa68e5082504111687d9df0e384c14dbf17d8cfa405a" +checksum = "3d7fdf5efbebabc0c0bb46c0348ef0d4db505856c7d6c5d50cebba1e5eda5fe4" dependencies = [ "async-trait", "bdk_core", @@ -1965,9 +1845,9 @@ dependencies = [ [[package]] name = "bdk_wallet" -version = "1.0.0-beta.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "627ad309b5dc5adec0491141d40fcb8d032209c373dd47a870c702e9e5eba36a" +checksum = "2c6362d350e13a94f68a102dafadbcc1500705016e4c2971b4c4e6f46054cb18" dependencies = [ "bdk_chain", "bitcoin", @@ -2249,19 +2129,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel 2.3.1", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - [[package]] name = "bls12_381" version = "0.7.1" @@ -2859,15 +2726,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "config" version = "0.14.0" @@ -3884,16 +3742,16 @@ dependencies = [ [[package]] name = "esplora-client" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23be31c97b2e505ac6af0d72a201caead71298a957639061a10314f6d4860cd7" +checksum = "d0da3c186d286e046253ccdc4bb71aa87ef872e4eff2045947c0c4fe3d2b2efc" dependencies = [ - "async-std", "bitcoin", "hex-conservative", "log", "reqwest 0.11.27", "serde", + "tokio", ] [[package]] @@ -4166,33 +4024,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b90ca2580b73ab6a1f724b76ca11ab632df820fd6040c336200d2c1df7b3c82c" -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "eyre" version = "0.6.12" @@ -4503,19 +4334,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-locks" version = "0.7.1" @@ -4555,7 +4373,7 @@ version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" dependencies = [ - "gloo-timers 0.2.6", + "gloo-timers", "send_wrapper 0.4.0", ] @@ -4700,18 +4518,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "gloo-utils" version = "0.2.0" @@ -4809,16 +4615,6 @@ dependencies = [ "rayon", ] -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash 0.4.8", - "serde", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -4831,7 +4627,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -4840,7 +4636,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -4912,12 +4708,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hex" version = "0.4.3" @@ -6084,15 +5874,6 @@ dependencies = [ "libc", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy-regex" version = "3.3.0" @@ -6334,9 +6115,6 @@ name = "log" version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -dependencies = [ - "value-bag", -] [[package]] name = "lru" @@ -6473,7 +6251,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884adb57038347dfbaf2d5065887b6cf4312330dc8e94bc30a1a839bd79d3261" dependencies = [ - "ahash 0.8.11", + "ahash", "portable-atomic", ] @@ -6608,7 +6386,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "log", "wasi", @@ -6932,7 +6710,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] @@ -7567,12 +7345,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - [[package]] name = "parking_lot" version = "0.11.2" @@ -7827,17 +7599,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -7854,21 +7615,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "polling" -version = "3.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "pollster" version = "0.3.0" @@ -8900,7 +8646,7 @@ name = "reth-cli-commands" version = "1.1.0" source = "git+https://github.com/paradigmxyz/reth.git?rev=v1.1.0#1ba631ba9581973e7c6cadeea92cfe1802aceb4a" dependencies = [ - "ahash 0.8.11", + "ahash", "alloy-eips 0.4.2", "alloy-primitives 0.8.12", "backon", @@ -11670,7 +11416,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -15051,12 +14797,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" - [[package]] name = "vcpkg" version = "0.2.15" diff --git a/Cargo.toml b/Cargo.toml index 78038a087..0d4e6ce5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -183,6 +183,13 @@ arbitrary = { version = "1.3.2", features = ["derive"] } argh = "0.1" async-trait = "0.1.80" base64 = "0.22.1" +bdk_bitcoind_rpc = "0.17.1" +bdk_esplora = { version = "0.20.1", features = [ + "async-https", + "async-https-rustls", + "tokio", +], default-features = false } +bdk_wallet = "1.0.0" bincode = "1.3" bitcoin = { version = "=0.32.5", features = ["serde"] } borsh = { version = "1.5.0", features = ["derive"] } diff --git a/bin/strata-cli/Cargo.toml b/bin/strata-cli/Cargo.toml index 2d83275a9..3344daff4 100644 --- a/bin/strata-cli/Cargo.toml +++ b/bin/strata-cli/Cargo.toml @@ -24,12 +24,9 @@ alloy = { version = "0.3.5", features = [ argh.workspace = true argon2 = "0.5.3" async-trait.workspace = true -bdk_bitcoind_rpc = "0.16.0" -bdk_esplora = { version = "0.19.0", features = [ - "async-https", - "async-https-rustls", -], default-features = false } -bdk_wallet = { version = "1.0.0-beta.5", features = ["rusqlite"] } +bdk_bitcoind_rpc.workspace = true +bdk_esplora.workspace = true +bdk_wallet = { workspace = true, features = ["rusqlite"] } bip39 = { version = "2.0.0", features = ["all-languages"] } config = { version = "0.14.0", default-features = false, features = ["toml"] } console = "0.15.8" diff --git a/bin/strata-cli/src/cmd/deposit.rs b/bin/strata-cli/src/cmd/deposit.rs index aebddc9e9..02acd1a77 100644 --- a/bin/strata-cli/src/cmd/deposit.rs +++ b/bin/strata-cli/src/cmd/deposit.rs @@ -112,16 +112,15 @@ pub async fn deposit( .copy_from_slice(recovery_script_hash.as_raw_hash().as_byte_array()); op_return_data[MBL + TNHL..].copy_from_slice(strata_address.as_slice()); - let mut psbt = l1w - .build_tx() + let mut psbt = { + let mut builder = l1w.build_tx(); // Important: the deposit won't be found by the sequencer if the order isn't correct. - .ordering(TxOrdering::Untouched) - .add_recipient(bridge_in_address.script_pubkey(), BRIDGE_IN_AMOUNT) - .add_data(&op_return_data) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid psbt"); + builder.ordering(TxOrdering::Untouched); + builder.add_recipient(bridge_in_address.script_pubkey(), BRIDGE_IN_AMOUNT); + builder.add_data(&op_return_data); + builder.fee_rate(fee_rate); + builder.finish().expect("valid psbt") + }; l1w.sign(&mut psbt, Default::default()).unwrap(); let _ = term.write_line("Built transaction"); diff --git a/bin/strata-cli/src/cmd/drain.rs b/bin/strata-cli/src/cmd/drain.rs index 6bffb58fc..269f7245d 100644 --- a/bin/strata-cli/src/cmd/drain.rs +++ b/bin/strata-cli/src/cmd/drain.rs @@ -73,14 +73,13 @@ pub async fn drain( let fee_rate = get_fee_rate(fee_rate, settings.signet_backend.as_ref()).await; log_fee_rate(&term, &fee_rate); - let mut psbt = l1w - .build_tx() - .drain_wallet() - .drain_to(address.script_pubkey()) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid transaction"); + let mut psbt = { + let mut builder = l1w.build_tx(); + builder.drain_wallet(); + builder.drain_to(address.script_pubkey()); + builder.fee_rate(fee_rate); + builder.finish().expect("valid transaction") + }; l1w.sign(&mut psbt, Default::default()).unwrap(); let tx = psbt.extract_tx().expect("fully signed tx"); settings.signet_backend.broadcast_tx(&tx).await.unwrap(); diff --git a/bin/strata-cli/src/cmd/recover.rs b/bin/strata-cli/src/cmd/recover.rs index eef7621ce..395ab37fa 100644 --- a/bin/strata-cli/src/cmd/recover.rs +++ b/bin/strata-cli/src/cmd/recover.rs @@ -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 @@ pub async fn recover(args: RecoverArgs, seed: Seed, settings: Settings) { continue; } + // F***! BDK 1.0 removed the `insert_tx` method, so we have to do this the hard way + // 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"); }); let recover_to = l1w.reveal_next_address(KeychainKind::External).address; @@ -88,13 +100,12 @@ pub async fn recover(args: RecoverArgs, seed: Seed, settings: Settings) { )); // 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()) diff --git a/bin/strata-cli/src/cmd/send.rs b/bin/strata-cli/src/cmd/send.rs index ee1f9492b..cf89ba0a5 100644 --- a/bin/strata-cli/src/cmd/send.rs +++ b/bin/strata-cli/src/cmd/send.rs @@ -58,13 +58,12 @@ pub async fn send(args: SendArgs, seed: Seed, settings: Settings) { l1w.sync().await.unwrap(); let fee_rate = get_fee_rate(args.fee_rate, settings.signet_backend.as_ref()).await; log_fee_rate(&term, &fee_rate); - let mut psbt = l1w - .build_tx() - .add_recipient(address.script_pubkey(), amount) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid psbt"); + let mut psbt = { + let mut builder = l1w.build_tx(); + builder.add_recipient(address.script_pubkey(), amount); + builder.fee_rate(fee_rate); + builder.finish().expect("valid psbt") + }; l1w.sign(&mut psbt, Default::default()) .expect("signable psbt"); let tx = psbt.extract_tx().expect("signed tx"); diff --git a/bin/strata-cli/src/signet/backend.rs b/bin/strata-cli/src/signet/backend.rs index 091131b4e..51b309414 100644 --- a/bin/strata-cli/src/signet/backend.rs +++ b/bin/strata-cli/src/signet/backend.rs @@ -15,7 +15,7 @@ use bdk_esplora::EsploraAsyncExt; use bdk_wallet::{ bitcoin::{consensus::encode, Block, FeeRate, Transaction}, chain::{ - spk_client::{FullScanRequestBuilder, FullScanResult, SyncRequestBuilder, SyncResult}, + spk_client::{FullScanRequestBuilder, FullScanResponse, SyncRequestBuilder, SyncResponse}, CheckPoint, }, KeychainKind, @@ -65,8 +65,8 @@ pub struct GetFeeRateError(BoxedErr); boxed_err!(GetFeeRateError); pub enum WalletUpdate { - SpkSync(SyncResult), - SpkScan(FullScanResult), + SpkSync(SyncResponse), + SpkScan(FullScanResponse), NewBlock(BlockEvent), MempoolTxs(Vec<(Transaction, u64)>), } diff --git a/crates/util/python-utils/Cargo.toml b/crates/util/python-utils/Cargo.toml index 65f5cae61..b98a6e0f4 100644 --- a/crates/util/python-utils/Cargo.toml +++ b/crates/util/python-utils/Cargo.toml @@ -15,9 +15,8 @@ crate-type = ["cdylib"] [dependencies] shrex = { version = "0.1.0", path = "../shrex", features = ["serde"] } -bdk_bitcoind_rpc = "0.16.0" -# TODO: once bdk_wallet 1.0 is released, update this and don't change! -bdk_wallet = "1.0.0-beta.5" +bdk_bitcoind_rpc.workspace = true +bdk_wallet.workspace = true musig2.workspace = true # "abi3-py310" tells pyo3 (and maturin) to build using the stable ABI with minimum Python version 3.10 pyo3 = { version = "0.22.6", features = ["extension-module", "abi3-py310"] } diff --git a/crates/util/python-utils/src/drt.rs b/crates/util/python-utils/src/drt.rs index ab9783710..349ab79fd 100644 --- a/crates/util/python-utils/src/drt.rs +++ b/crates/util/python-utils/src/drt.rs @@ -110,16 +110,15 @@ fn deposit_request_transaction_inner( // Before signing the transaction, we need to sync the wallet with bitcoind sync_wallet(&mut wallet, &client)?; - let mut psbt = wallet - .build_tx() + let mut psbt = { + let mut builder = wallet.build_tx(); // NOTE: the deposit won't be found by the sequencer if the order isn't correct. - .ordering(TxOrdering::Untouched) - .add_recipient(bridge_in_address.script_pubkey(), BRIDGE_IN_AMOUNT) - .add_data(&op_return_data) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid psbt"); + builder.ordering(TxOrdering::Untouched); + builder.add_recipient(bridge_in_address.script_pubkey(), BRIDGE_IN_AMOUNT); + builder.add_data(&op_return_data); + builder.fee_rate(fee_rate); + builder.finish().expect("valid psbt") + }; wallet.sign(&mut psbt, Default::default()).unwrap(); let tx = psbt.extract_tx().expect("valid tx"); @@ -216,15 +215,14 @@ fn spend_recovery_path_inner( sync_wallet(&mut wallet, &client)?; // Spend the recovery path - let mut psbt = wallet - .build_tx() - .policy_path(path, KeychainKind::External) - .drain_wallet() - .drain_to(address_to_send.script_pubkey()) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid psbt"); + let mut psbt = { + let mut builder = wallet.build_tx(); + builder.policy_path(path, KeychainKind::External); + builder.drain_wallet(); + builder.drain_to(address_to_send.script_pubkey()); + builder.fee_rate(fee_rate); + builder.finish().expect("valid psbt") + }; wallet.sign(&mut psbt, Default::default()).unwrap(); let tx = psbt.extract_tx().expect("valid tx"); @@ -669,13 +667,12 @@ mod tests { // Send 10 BTC to the change address let amount = Amount::from_btc(10.0).unwrap(); - let mut psbt = wallet - .build_tx() - .add_recipient(change_address.script_pubkey(), amount) - .fee_rate(FeeRate::from_sat_per_vb_unchecked(2)) - .clone() - .finish() - .unwrap(); + let mut psbt = { + let mut builder = wallet.build_tx(); + builder.add_recipient(change_address.script_pubkey(), amount); + builder.fee_rate(FeeRate::from_sat_per_vb_unchecked(2)); + builder.finish().unwrap() + }; wallet.sign(&mut psbt, Default::default()).unwrap(); let signed_tx = psbt.extract_tx().unwrap(); trace!(?signed_tx, "signed drt tx"); diff --git a/crates/util/python-utils/src/taproot.rs b/crates/util/python-utils/src/taproot.rs index 60461b897..1a5541c27 100644 --- a/crates/util/python-utils/src/taproot.rs +++ b/crates/util/python-utils/src/taproot.rs @@ -251,14 +251,13 @@ fn drain_wallet_inner( // Before signing the transaction, we need to sync the wallet with bitcoind sync_wallet(&mut wallet, &client)?; - let mut psbt = wallet - .build_tx() - .drain_wallet() - .drain_to(address.script_pubkey()) - .fee_rate(fee_rate) - .clone() - .finish() - .expect("valid psbt"); + let mut psbt = { + let mut builder = wallet.build_tx(); + builder.drain_wallet(); + builder.drain_to(address.script_pubkey()); + builder.fee_rate(fee_rate); + builder.finish().expect("valid psbt") + }; wallet .sign(&mut psbt, Default::default()) .expect("valid psbt");