Skip to content

Commit

Permalink
Update to bdk v0.22.0
Browse files Browse the repository at this point in the history
This commit adds patches to update to bdk v0.22. Fixes some imports.
Refers to bdk-reserve as the open PR that updates bdk-reserve to
bdk v0.22.0.
  • Loading branch information
rajarshimaitra committed Sep 5, 2022
1 parent 26d7914 commit 6cb4acf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
10 changes: 4 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]

Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
14 changes: 12 additions & 2 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 6cb4acf

Please sign in to comment.