diff --git a/crates/bitcoind_rpc/Cargo.toml b/crates/bitcoind_rpc/Cargo.toml index 98992328d..1d67a0f3e 100644 --- a/crates/bitcoind_rpc/Cargo.toml +++ b/crates/bitcoind_rpc/Cargo.toml @@ -20,7 +20,6 @@ bdk_chain = { path = "../chain", version = "0.13", default-features = false } [dev-dependencies] bdk_testenv = { path = "../testenv", default_features = false } -anyhow = { version = "1" } [features] default = ["std"] diff --git a/crates/bitcoind_rpc/tests/test_emitter.rs b/crates/bitcoind_rpc/tests/test_emitter.rs index c517740f5..69bbc0401 100644 --- a/crates/bitcoind_rpc/tests/test_emitter.rs +++ b/crates/bitcoind_rpc/tests/test_emitter.rs @@ -7,7 +7,7 @@ use bdk_chain::{ local_chain::{CheckPoint, LocalChain}, Append, BlockId, IndexedTxGraph, SpkTxOutIndex, }; -use bdk_testenv::TestEnv; +use bdk_testenv::{electrsd::bitcoind::anyhow, TestEnv}; use bitcoin::{hashes::Hash, Block, OutPoint, ScriptBuf, WScriptHash}; use bitcoincore_rpc::RpcApi; diff --git a/crates/electrum/Cargo.toml b/crates/electrum/Cargo.toml index 4205f2294..2f7896f77 100644 --- a/crates/electrum/Cargo.toml +++ b/crates/electrum/Cargo.toml @@ -17,6 +17,4 @@ electrum-client = { version = "0.19" } #rustls = { version = "=0.21.1", optional = true, features = ["dangerous_configuration"] } [dev-dependencies] -bdk_testenv = { path = "../testenv", default-features = false } -electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] } -anyhow = "1" +bdk_testenv = { path = "../testenv", default-features = false } \ No newline at end of file diff --git a/crates/electrum/tests/test_electrum.rs b/crates/electrum/tests/test_electrum.rs index 8f77209fc..798a63f7b 100644 --- a/crates/electrum/tests/test_electrum.rs +++ b/crates/electrum/tests/test_electrum.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use bdk_chain::{ bitcoin::{hashes::Hash, Address, Amount, ScriptBuf, WScriptHash}, keychain::Balance, @@ -6,8 +5,10 @@ use bdk_chain::{ ConfirmationTimeHeightAnchor, IndexedTxGraph, SpkTxOutIndex, }; use bdk_electrum::{ElectrumExt, ElectrumUpdate}; -use bdk_testenv::TestEnv; -use electrsd::bitcoind::bitcoincore_rpc::RpcApi; +use bdk_testenv::{ + electrsd::bitcoind::{anyhow, anyhow::Result, bitcoincore_rpc::RpcApi}, + TestEnv, +}; fn get_balance( recv_chain: &LocalChain, diff --git a/crates/esplora/Cargo.toml b/crates/esplora/Cargo.toml index d91627d3d..4e791a361 100644 --- a/crates/esplora/Cargo.toml +++ b/crates/esplora/Cargo.toml @@ -25,7 +25,6 @@ miniscript = { version = "11.0.0", optional = true, default-features = false } bdk_testenv = { path = "../testenv", default_features = false } electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] } tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] } -anyhow = "1" [features] default = ["std", "async-https", "blocking-https-rustls"] diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 2942d2744..850b02ab1 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -417,8 +417,10 @@ mod test { local_chain::LocalChain, BlockId, }; - use bdk_testenv::TestEnv; - use electrsd::bitcoind::bitcoincore_rpc::RpcApi; + use bdk_testenv::{ + electrsd::bitcoind::{anyhow::Result, bitcoincore_rpc::RpcApi}, + TestEnv, + }; use esplora_client::Builder; use crate::async_ext::{chain_update, fetch_latest_blocks}; @@ -431,7 +433,7 @@ mod test { /// Ensure that update does not remove heights (from original), and all anchor heights are included. #[tokio::test] - pub async fn test_finalize_chain_update() -> anyhow::Result<()> { + pub async fn test_finalize_chain_update() -> Result<()> { struct TestCase<'a> { name: &'a str, /// Initial blockchain height to start the env with. @@ -494,7 +496,7 @@ mod test { let anchors = t .initial_cps .iter() - .map(|&height| -> anyhow::Result<_> { + .map(|&height| -> Result<_> { Ok(( BlockId { height, @@ -503,7 +505,7 @@ mod test { Txid::all_zeros(), )) }) - .collect::>>()?; + .collect::>>()?; let update = chain_update( &client, &fetch_latest_blocks(&client).await?, @@ -532,7 +534,7 @@ mod test { let anchors = t .anchors .iter() - .map(|&(height, txid)| -> anyhow::Result<_> { + .map(|&(height, txid)| -> Result<_> { Ok(( BlockId { height, @@ -541,7 +543,7 @@ mod test { txid, )) }) - .collect::>()?; + .collect::>()?; chain_update( &client, &fetch_latest_blocks(&client).await?, diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 469ab52e6..b0df6ec8d 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -407,8 +407,10 @@ mod test { use bdk_chain::bitcoin::Txid; use bdk_chain::local_chain::LocalChain; use bdk_chain::BlockId; - use bdk_testenv::TestEnv; - use electrsd::bitcoind::bitcoincore_rpc::RpcApi; + use bdk_testenv::{ + electrsd::bitcoind::{anyhow::Result, bitcoincore_rpc::RpcApi}, + TestEnv, + }; use esplora_client::{BlockHash, Builder}; use std::collections::{BTreeMap, BTreeSet}; use std::time::Duration; @@ -429,7 +431,7 @@ mod test { /// Ensure that update does not remove heights (from original), and all anchor heights are included. #[test] - pub fn test_finalize_chain_update() -> anyhow::Result<()> { + pub fn test_finalize_chain_update() -> Result<()> { struct TestCase<'a> { name: &'a str, /// Initial blockchain height to start the env with. @@ -492,7 +494,7 @@ mod test { let anchors = t .initial_cps .iter() - .map(|&height| -> anyhow::Result<_> { + .map(|&height| -> Result<_> { Ok(( BlockId { height, @@ -501,7 +503,7 @@ mod test { Txid::all_zeros(), )) }) - .collect::>>()?; + .collect::>>()?; let update = chain_update( &client, &fetch_latest_blocks(&client)?, @@ -529,7 +531,7 @@ mod test { let anchors = t .anchors .iter() - .map(|&(height, txid)| -> anyhow::Result<_> { + .map(|&(height, txid)| -> Result<_> { Ok(( BlockId { height, @@ -538,7 +540,7 @@ mod test { txid, )) }) - .collect::>()?; + .collect::>()?; chain_update( &client, &fetch_latest_blocks(&client)?, @@ -592,7 +594,7 @@ mod test { } #[test] - fn update_local_chain() -> anyhow::Result<()> { + fn update_local_chain() -> Result<()> { const TIP_HEIGHT: u32 = 50; let env = TestEnv::new()?;