diff --git a/crates/bitcoind_rpc/Cargo.toml b/crates/bitcoind_rpc/Cargo.toml index bb18bb05ca..48e0bf55cc 100644 --- a/crates/bitcoind_rpc/Cargo.toml +++ b/crates/bitcoind_rpc/Cargo.toml @@ -20,7 +20,6 @@ bdk_chain = { path = "../chain", version = "0.12", 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 c517740f51..69bbc04014 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 ef5051d68d..443cadbe74 100644 --- a/crates/electrum/Cargo.toml +++ b/crates/electrum/Cargo.toml @@ -17,5 +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 } -anyhow = "1" \ No newline at end of file +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 da5a3d0cee..798a63f7b6 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,7 +5,10 @@ use bdk_chain::{ ConfirmationTimeHeightAnchor, IndexedTxGraph, SpkTxOutIndex, }; use bdk_electrum::{ElectrumExt, ElectrumUpdate}; -use bdk_testenv::{electrsd::bitcoind::bitcoincore_rpc::RpcApi, TestEnv}; +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 3cca71a892..8ecfe8634f 100644 --- a/crates/esplora/Cargo.toml +++ b/crates/esplora/Cargo.toml @@ -24,7 +24,6 @@ miniscript = { version = "11.0.0", optional = true, default-features = false } [dev-dependencies] bdk_testenv = { path = "../testenv", default_features = false } 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 5de9cfab63..5e78d65b6a 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -409,7 +409,10 @@ mod test { local_chain::LocalChain, BlockId, }; - use bdk_testenv::{electrsd::bitcoind::bitcoincore_rpc::RpcApi, TestEnv}; + use bdk_testenv::{ + electrsd::bitcoind::{anyhow::Result, bitcoincore_rpc::RpcApi}, + TestEnv, + }; use esplora_client::Builder; use crate::async_ext::{chain_update, fetch_latest_blocks}; @@ -422,7 +425,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. @@ -485,7 +488,7 @@ mod test { let anchors = t .initial_cps .iter() - .map(|&height| -> anyhow::Result<_> { + .map(|&height| -> Result<_> { Ok(( BlockId { height, @@ -494,7 +497,7 @@ mod test { Txid::all_zeros(), )) }) - .collect::>>()?; + .collect::>>()?; let update = chain_update( &client, &fetch_latest_blocks(&client).await?, @@ -523,7 +526,7 @@ mod test { let anchors = t .anchors .iter() - .map(|&(height, txid)| -> anyhow::Result<_> { + .map(|&(height, txid)| -> Result<_> { Ok(( BlockId { height, @@ -532,7 +535,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 8312fd5e6a..01ef475769 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -414,7 +414,10 @@ mod test { use bdk_chain::bitcoin::Txid; use bdk_chain::local_chain::LocalChain; use bdk_chain::BlockId; - use bdk_testenv::{electrsd::bitcoind::bitcoincore_rpc::RpcApi, TestEnv}; + 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; @@ -435,7 +438,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. @@ -498,7 +501,7 @@ mod test { let anchors = t .initial_cps .iter() - .map(|&height| -> anyhow::Result<_> { + .map(|&height| -> Result<_> { Ok(( BlockId { height, @@ -507,7 +510,7 @@ mod test { Txid::all_zeros(), )) }) - .collect::>>()?; + .collect::>>()?; let update = chain_update( &client, &fetch_latest_blocks(&client)?, @@ -535,7 +538,7 @@ mod test { let anchors = t .anchors .iter() - .map(|&(height, txid)| -> anyhow::Result<_> { + .map(|&(height, txid)| -> Result<_> { Ok(( BlockId { height, @@ -544,7 +547,7 @@ mod test { txid, )) }) - .collect::>()?; + .collect::>()?; chain_update( &client, &fetch_latest_blocks(&client)?, @@ -598,7 +601,7 @@ mod test { } #[test] - fn update_local_chain() -> anyhow::Result<()> { + fn update_local_chain() -> Result<()> { const TIP_HEIGHT: u32 = 50; let env = TestEnv::new()?;