Skip to content

Commit 23538c4

Browse files
committed
Merge #1414: chore: clean up electrsd and anyhow dev dependencies
f6218e4 chore: reexport crates in `TestEnv` (Wei Chen) 1259599 chore: remove `anyhow` dev dependency from `electrum`, `esplora`, and `bitcoind_rpc` (Wei Chen) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### Description Reexports `electrsd` in `TestEnv` to remove the `electrsd` dev depedency out of `bdk_electrum` and `bdk_esplora`. Credit to @ValuedMammal for the idea. Since `bitcoind` reexports `anyhow`, this dev dependency was also removed from `bdk_electrum`, `bdk_esplora`, and `bdk_bitcoind_rpc`. `bitcoind`, `bitcoincore_rpc` and `electrum_client` were also reexported for convenience. ### Changelog notice * Change `bdk_testenv` to re-export internally used crates. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing ACKs for top commit: evanlinjin: ACK f6218e4 Tree-SHA512: c7645eb91d08d4ccb80982a992f691b5a8c0df39df506f6b361bc6f2bb076d62cbe5bb5d88b4c684c36e22464c0674f21f6ef4e23733f89b03aa12ec43a67cba
2 parents a9f7377 + f6218e4 commit 23538c4

File tree

11 files changed

+13
-24
lines changed

11 files changed

+13
-24
lines changed

crates/bitcoind_rpc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ bdk_chain = { path = "../chain", version = "0.13", default-features = false }
2020

2121
[dev-dependencies]
2222
bdk_testenv = { path = "../testenv", default_features = false }
23-
anyhow = { version = "1" }
2423

2524
[features]
2625
default = ["std"]

crates/bitcoind_rpc/tests/test_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bdk_chain::{
77
local_chain::{CheckPoint, LocalChain},
88
Append, BlockId, IndexedTxGraph, SpkTxOutIndex,
99
};
10-
use bdk_testenv::TestEnv;
10+
use bdk_testenv::{anyhow, TestEnv};
1111
use bitcoin::{hashes::Hash, Block, OutPoint, ScriptBuf, WScriptHash};
1212
use bitcoincore_rpc::RpcApi;
1313

crates/electrum/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,4 @@ electrum-client = { version = "0.19" }
1717
#rustls = { version = "=0.21.1", optional = true, features = ["dangerous_configuration"] }
1818

1919
[dev-dependencies]
20-
bdk_testenv = { path = "../testenv", default-features = false }
21-
electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] }
22-
anyhow = "1"
20+
bdk_testenv = { path = "../testenv", default-features = false }

crates/electrum/tests/test_electrum.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
use anyhow::Result;
21
use bdk_chain::{
32
bitcoin::{hashes::Hash, Address, Amount, ScriptBuf, WScriptHash},
43
keychain::Balance,
54
local_chain::LocalChain,
65
ConfirmationTimeHeightAnchor, IndexedTxGraph, SpkTxOutIndex,
76
};
87
use bdk_electrum::{ElectrumExt, ElectrumUpdate};
9-
use bdk_testenv::TestEnv;
10-
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
8+
use bdk_testenv::{anyhow, anyhow::Result, bitcoincore_rpc::RpcApi, TestEnv};
119

1210
fn get_balance(
1311
recv_chain: &LocalChain,

crates/esplora/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ miniscript = { version = "11.0.0", optional = true, default-features = false }
2323

2424
[dev-dependencies]
2525
bdk_testenv = { path = "../testenv", default_features = false }
26-
electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] }
2726
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
28-
anyhow = "1"
2927

3028
[features]
3129
default = ["std", "async-https", "blocking-https-rustls"]

crates/esplora/src/async_ext.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@ mod test {
411411
local_chain::LocalChain,
412412
BlockId,
413413
};
414-
use bdk_testenv::TestEnv;
415-
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
414+
use bdk_testenv::{anyhow, bitcoincore_rpc::RpcApi, TestEnv};
416415
use esplora_client::Builder;
417416

418417
use crate::async_ext::{chain_update, fetch_latest_blocks};

crates/esplora/src/blocking_ext.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,7 @@ mod test {
401401
use bdk_chain::bitcoin::Txid;
402402
use bdk_chain::local_chain::LocalChain;
403403
use bdk_chain::BlockId;
404-
use bdk_testenv::TestEnv;
405-
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
404+
use bdk_testenv::{anyhow, bitcoincore_rpc::RpcApi, TestEnv};
406405
use esplora_client::{BlockHash, Builder};
407406
use std::collections::{BTreeMap, BTreeSet};
408407
use std::time::Duration;

crates/esplora/tests/async_ext.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
use bdk_chain::spk_client::{FullScanRequest, SyncRequest};
22
use bdk_esplora::EsploraAsyncExt;
3-
use electrsd::bitcoind::anyhow;
4-
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
53
use esplora_client::{self, Builder};
64
use std::collections::{BTreeSet, HashSet};
75
use std::str::FromStr;
86
use std::thread::sleep;
97
use std::time::Duration;
108

119
use bdk_chain::bitcoin::{Address, Amount, Txid};
12-
use bdk_testenv::TestEnv;
10+
use bdk_testenv::{anyhow, bitcoincore_rpc::RpcApi, TestEnv};
1311

1412
#[tokio::test]
1513
pub async fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {

crates/esplora/tests/blocking_ext.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
use bdk_chain::spk_client::{FullScanRequest, SyncRequest};
22
use bdk_esplora::EsploraExt;
3-
use electrsd::bitcoind::anyhow;
4-
use electrsd::bitcoind::bitcoincore_rpc::RpcApi;
53
use esplora_client::{self, Builder};
64
use std::collections::{BTreeSet, HashSet};
75
use std::str::FromStr;
86
use std::thread::sleep;
97
use std::time::Duration;
108

119
use bdk_chain::bitcoin::{Address, Amount, Txid};
12-
use bdk_testenv::TestEnv;
10+
use bdk_testenv::{anyhow, bitcoincore_rpc::RpcApi, TestEnv};
1311

1412
#[test]
1513
pub fn test_update_tx_graph_without_keychain() -> anyhow::Result<()> {

crates/testenv/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ readme = "README.md"
1313
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1414

1515
[dependencies]
16-
bitcoincore-rpc = { version = "0.18" }
1716
bdk_chain = { path = "../chain", version = "0.13", default-features = false }
1817
electrsd = { version= "0.27.1", features = ["bitcoind_25_0", "esplora_a33e97e1", "legacy"] }
19-
anyhow = { version = "1" }
2018

2119
[features]
2220
default = ["std"]

0 commit comments

Comments
 (0)