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 2, 2022
1 parent 013daa6 commit 716efe8
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,9 +25,14 @@ 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}


[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 @@ -458,7 +458,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 716efe8

Please sign in to comment.