From ee8b992f8bb9f648b0593b9eead877ec1906d154 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Wed, 27 Oct 2021 13:42:01 -0700 Subject: [PATCH] Update dev-dependencies electrsd to 0.12 --- Cargo.toml | 8 ++++---- src/testutils/blockchain_tests.rs | 22 +++++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3a7097a6..087d9ac5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ backtrace = { version = "=0.3.61", optional = true } bitcoinconsensus = { version = "0.19.0-3", optional = true } # Needed by bdk_blockchain_tests macro -core-rpc = { version = "0.14", optional = true } +bitcoincore-rpc = { version = "0.14", optional = true } # Platform-specific dependencies [target.'cfg(not(target_arch = "wasm32"))'.dependencies] @@ -66,7 +66,7 @@ compact_filters = ["rocksdb", "socks", "lazy_static", "cc"] key-value-db = ["sled"] all-keys = ["keys-bip39"] keys-bip39 = ["tiny-bip39", "backtrace"] -rpc = ["core-rpc"] +rpc = ["bitcoincore-rpc"] # We currently provide mulitple implementations of `Blockchain`, all are # blocking except for the `EsploraBlockchain` which can be either async or @@ -91,7 +91,7 @@ esplora = [] # Debug/Test features -test-blockchains = ["core-rpc", "electrum-client"] +test-blockchains = ["bitcoincore-rpc", "electrum-client"] test-electrum = ["electrum", "electrsd/electrs_0_8_10", "test-blockchains"] test-rpc = ["rpc", "electrsd/electrs_0_8_10", "test-blockchains"] test-esplora = ["electrsd/legacy", "electrsd/esplora_a33e97e1", "test-blockchains"] @@ -101,7 +101,7 @@ test-md-docs = ["electrum"] lazy_static = "1.4" env_logger = "0.7" clap = "2.33" -electrsd = { version= "0.10", features = ["trigger", "bitcoind_0_21_1"] } +electrsd = { version= "0.12", features = ["trigger", "bitcoind_0_21_1"] } [[example]] name = "address_validator" diff --git a/src/testutils/blockchain_tests.rs b/src/testutils/blockchain_tests.rs index 0d1b9167..085745b0 100644 --- a/src/testutils/blockchain_tests.rs +++ b/src/testutils/blockchain_tests.rs @@ -3,11 +3,11 @@ use bitcoin::consensus::encode::{deserialize, serialize}; use bitcoin::hashes::hex::{FromHex, ToHex}; use bitcoin::hashes::sha256d; use bitcoin::{Address, Amount, Script, Transaction, Txid}; +pub use bitcoincore_rpc::bitcoincore_rpc_json::AddressType; +pub use bitcoincore_rpc::{Auth, Client as RpcClient, RpcApi}; use core::str::FromStr; -pub use core_rpc::core_rpc_json::AddressType; -pub use core_rpc::{Auth, Client as RpcClient, RpcApi}; use electrsd::bitcoind::BitcoinD; -use electrsd::{bitcoind, Conf, ElectrsD}; +use electrsd::{bitcoind, ElectrsD}; pub use electrum_client::{Client as ElectrumClient, ElectrumApi}; #[allow(unused_imports)] use log::{debug, error, info, log_enabled, trace, Level}; @@ -24,19 +24,15 @@ pub struct TestClient { impl TestClient { pub fn new(bitcoind_exe: String, electrs_exe: String) -> Self { debug!("launching {} and {}", &bitcoind_exe, &electrs_exe); - let conf = bitcoind::Conf { - view_stdout: log_enabled!(Level::Debug), - ..Default::default() - }; + + let mut conf = bitcoind::Conf::default(); + conf.view_stdout = log_enabled!(Level::Debug); let bitcoind = BitcoinD::with_conf(bitcoind_exe, &conf).unwrap(); - let http_enabled = cfg!(feature = "test-esplora"); + let mut conf = electrsd::Conf::default(); + conf.view_stderr = log_enabled!(Level::Debug); + conf.http_enabled = cfg!(feature = "test-esplora"); - let conf = Conf { - http_enabled, - view_stderr: log_enabled!(Level::Debug), - ..Default::default() - }; let electrsd = ElectrsD::with_conf(electrs_exe, &bitcoind, &conf).unwrap(); let node_address = bitcoind.client.get_new_address(None, None).unwrap();