Skip to content

Commit

Permalink
chore: reexport electrsd in TestEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
LagginTimes committed Apr 26, 2024
1 parent 8e73998 commit 651f9c0
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion crates/electrum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ electrum-client = { version = "0.19" }

[dev-dependencies]
bdk_testenv = { path = "../testenv", default-features = false }
electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] }
anyhow = "1"
3 changes: 1 addition & 2 deletions crates/electrum/tests/test_electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ 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::bitcoincore_rpc::RpcApi, TestEnv};

fn get_balance(
recv_chain: &LocalChain,
Expand Down
1 change: 0 additions & 1 deletion crates/esplora/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ miniscript = { version = "11.0.0", optional = true, default-features = false }

[dev-dependencies]
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"

Expand Down
2 changes: 1 addition & 1 deletion crates/esplora/src/async_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ mod test {
local_chain::LocalChain,
BlockId,
};
use bdk_testenv::electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use bdk_testenv::TestEnv;
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use esplora_client::Builder;

use crate::async_ext::{chain_update, fetch_latest_blocks};
Expand Down
2 changes: 1 addition & 1 deletion crates/esplora/src/blocking_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ 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;
use bdk_testenv::TestEnv;
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use esplora_client::{BlockHash, Builder};
use std::collections::{BTreeMap, BTreeSet};
use std::time::Duration;
Expand Down
4 changes: 2 additions & 2 deletions crates/esplora/tests/async_ext.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bdk_esplora::EsploraAsyncExt;
use electrsd::bitcoind::anyhow;
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use bdk_testenv::electrsd::bitcoind::anyhow;
use bdk_testenv::electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use esplora_client::{self, Builder};
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::str::FromStr;
Expand Down
4 changes: 2 additions & 2 deletions crates/esplora/tests/blocking_ext.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bdk_esplora::EsploraExt;
use electrsd::bitcoind::anyhow;
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use bdk_testenv::electrsd::bitcoind::anyhow;
use bdk_testenv::electrsd::bitcoind::bitcoincore_rpc::RpcApi;
use esplora_client::{self, Builder};
use std::collections::{BTreeMap, BTreeSet, HashSet};
use std::str::FromStr;
Expand Down
3 changes: 2 additions & 1 deletion crates/testenv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use bitcoincore_rpc::{
bitcoincore_rpc_json::{GetBlockTemplateModes, GetBlockTemplateRules},
RpcApi,
};
pub use electrsd;
use electrsd::electrum_client::ElectrumApi;
use std::time::Duration;

Expand Down Expand Up @@ -55,7 +56,7 @@ impl TestEnv {
}

/// Exposes the [`ElectrumApi`] calls from the Electrum client.
pub fn electrum_client(&self) -> &impl ElectrumApi {
pub fn electrum_client(&self) -> &impl electrsd::electrum_client::ElectrumApi {
&self.electrsd.client
}

Expand Down

0 comments on commit 651f9c0

Please sign in to comment.