diff --git a/Cargo.lock b/Cargo.lock index ef5ab5b..ef5f068 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,9 +97,8 @@ dependencies = [ [[package]] name = "bdk" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0becbf5a97855daca6717ff920c52a779cebf655b23ae1427e5366d2661e82" +version = "0.22.0-rc.1" +source = "git+https://github.com/bitcoindevkit/bdk?tag=0.22.0-rc.1#f2e12d0ccd83ac614eb1d2347cdade96dbfb0074" dependencies = [ "ahash", "async-trait", @@ -160,9 +159,8 @@ dependencies = [ [[package]] name = "bdk-reserves" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74853196bf39a8bbe3be5650c130c7e95b38fdaeae874df1dd100729d68ef4cf" +version = "0.22.0" +source = "git+https://github.com/bitcoindevkit/bdk-reserves.git?rev=refs/pull/11/head#dadb44ccb5a596154bd2ee159feeb8b4a3ebcaee" dependencies = [ "bdk", "bitcoinconsensus", diff --git a/Cargo.toml b/Cargo.toml index b93736e..143c878 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ readme = "README.md" license = "MIT" [dependencies] -bdk = { version = "0.20", default-features = false, features = ["all-keys"]} +bdk = { version = "0.22.0-rc.1", default-features = false, features = ["all-keys"]} bdk-macros = "0.6" structopt = "0.3" serde_json = "1.0" @@ -25,10 +25,15 @@ env_logger = "0.7" rustyline = { version = "~9.0", optional = true } fd-lock = { version = "=3.0.2", optional = true } regex = { version = "1", optional = true } -bdk-reserves = { version = "0.20", optional = true} +#bdk-reserves = { version = "0.22", optional = true} +bdk-reserves = { git = "https://github.com/bitcoindevkit/bdk-reserves.git", rev = "refs/pull/11/head", optional = true} electrsd = { version= "0.19", features = ["bitcoind_22_0"], optional = true} tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread"], optional = true } + +[patch.crates-io] +bdk = { git = "https://github.com/bitcoindevkit/bdk", tag = "0.22.0-rc.1"} + [features] default = ["repl", "sqlite-db"] diff --git a/src/utils.rs b/src/utils.rs index 7fc8e04..38d5725 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -28,7 +28,7 @@ use bdk::blockchain::compact_filters::{BitcoinPeerConfig, CompactFiltersBlockcha #[cfg(feature = "esplora")] use bdk::blockchain::esplora::EsploraBlockchainConfig; #[cfg(feature = "rpc")] -use bdk::blockchain::rpc::{Auth, RpcConfig}; +use bdk::blockchain::rpc::{Auth, RpcConfig, RpcSyncParams}; #[cfg(feature = "electrum")] use bdk::blockchain::ElectrumBlockchainConfig; #[cfg(any( @@ -461,7 +461,7 @@ pub(crate) fn new_blockchain( auth, network: _network, wallet_name, - skip_blocks: wallet_opts.rpc_opts.skip_blocks, + sync_params: Some(RpcSyncParams::default()), }; AnyBlockchainConfig::Rpc(rpc_config) diff --git a/tests/integration.rs b/tests/integration.rs index 52b9a59..01d7683 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -225,8 +225,18 @@ mod test { // Get the balance let balance_json = bdk_cli.wallet_exec(&["get_balance"]).unwrap(); - let balance = get_value(&balance_json, "satoshi").unwrap(); - assert_eq!(balance, "1000000000"); + let confirmed_balance = balance_json + .as_object() + .unwrap() + .get("satoshi") + .unwrap() + .as_object() + .unwrap() + .get("confirmed") + .unwrap() + .as_u64() + .unwrap(); + assert_eq!(confirmed_balance, 1000000000u64); } #[test]