Skip to content

Commit 75c9365

Browse files
committed
Merge bitcoindevkit#2193: [testenv] Bump electrsd to v0.38.0
7ba31dd chore(deps)!: bump `electrsd` to v0.38.0 (Luis Schwab) Pull request description: Closes bitcoindevkit#2183 ## Changelog ``` ### Changed Bump `electrsd` to v0.38.0 ``` ACKs for top commit: oleonardolima: ACK 7ba31dd tvpeter: tACK 7ba31dd ValuedMammal: ACK 7ba31dd Tree-SHA512: 53a9800e74dc63ff532a13fc7eabe123dd1a60cc6b9d81109e5bac63f85d0babf308b2dd9fb0021abde956a4e7aa567f42cec20b626e4e6a360a14cc7139d7f9
2 parents 0dbfdd2 + 7ba31dd commit 75c9365

8 files changed

Lines changed: 28 additions & 29 deletions

File tree

crates/bitcoind_rpc/tests/test_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use bdk_chain::{
99
};
1010
use bdk_testenv::{
1111
anyhow,
12-
corepc_node::{Input, Output},
12+
bitcoind::{Input, Output},
1313
TestEnv,
1414
};
1515
use bitcoin::{hashes::Hash, Block, Network, ScriptBuf, WScriptHash};

crates/bitcoind_rpc/tests/test_filter_iter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bdk_bitcoind_rpc::bip158::{Error, FilterIter};
22
use bdk_core::CheckPoint;
3-
use bdk_testenv::{anyhow, corepc_node, TestEnv};
3+
use bdk_testenv::{anyhow, bitcoind, TestEnv};
44
use bitcoin::{Address, Amount, Network, ScriptBuf};
55
use bitcoincore_rpc::RpcApi;
66

@@ -9,7 +9,7 @@ use crate::common::ClientExt;
99
mod common;
1010

1111
fn testenv() -> anyhow::Result<TestEnv> {
12-
let mut conf = corepc_node::Conf::default();
12+
let mut conf = bitcoind::Conf::default();
1313
conf.args.push("-blockfilterindex=1");
1414
conf.args.push("-peerblockfilters=1");
1515
TestEnv::new_with_config(bdk_testenv::Config {

crates/chain/tests/test_indexed_tx_graph.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ use bdk_chain::{
1515
};
1616
use bdk_testenv::{
1717
anyhow::{self},
18-
block_id,
19-
corepc_node::{Input, Output},
20-
hash,
18+
bitcoind::{Input, Output},
19+
block_id, hash,
2120
utils::{new_tx, DESCRIPTORS},
2221
TestEnv,
2322
};

crates/electrum/tests/test_electrum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use bdk_core::bitcoin::{
1313
use bdk_electrum::BdkElectrumClient;
1414
use bdk_testenv::{
1515
anyhow,
16-
corepc_node::{Input, Output},
16+
bitcoind::{Input, Output},
1717
TestEnv,
1818
};
1919
use core::time::Duration;
@@ -141,7 +141,7 @@ pub fn detect_receive_tx_cancel() -> anyhow::Result<()> {
141141
// Create and sign the `send_tx` that sends funds to the receiver address.
142142
let send_tx_outputs = [Output::new(
143143
receiver_addr,
144-
selected_utxo.amount.to_unsigned()? - SEND_TX_FEE,
144+
selected_utxo.amount - SEND_TX_FEE,
145145
)];
146146
let send_tx = rpc_client
147147
.create_raw_transaction(&inputs, &send_tx_outputs)?
@@ -156,7 +156,7 @@ pub fn detect_receive_tx_cancel() -> anyhow::Result<()> {
156156
// address.
157157
let undo_send_outputs = [Output::new(
158158
sender_addr,
159-
selected_utxo.amount.to_unsigned()? - UNDO_SEND_TX_FEE,
159+
selected_utxo.amount - UNDO_SEND_TX_FEE,
160160
)];
161161
let undo_send_tx = rpc_client
162162
.create_raw_transaction(&inputs, &undo_send_outputs)?

crates/esplora/tests/async_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bdk_chain::spk_client::{FullScanRequest, SyncRequest};
44
use bdk_chain::spk_txout::SpkTxOutIndex;
55
use bdk_chain::{ConfirmationBlockTime, IndexedTxGraph, TxGraph};
66
use bdk_esplora::EsploraAsyncExt;
7-
use bdk_testenv::corepc_node::{Input, Output};
7+
use bdk_testenv::bitcoind::{Input, Output};
88
use bdk_testenv::{anyhow, TestEnv};
99
use esplora_client::{self, Builder};
1010
use std::collections::{BTreeSet, HashSet};
@@ -62,7 +62,7 @@ pub async fn detect_receive_tx_cancel() -> anyhow::Result<()> {
6262

6363
// Create and sign the `send_tx` that sends funds to the receiver address.
6464
let address = receiver_addr;
65-
let value = selected_utxo.amount.to_unsigned()? - SEND_TX_FEE;
65+
let value = selected_utxo.amount - SEND_TX_FEE;
6666
let send_tx_outputs = Output::new(address, value);
6767

6868
let send_tx = rpc_client
@@ -78,7 +78,7 @@ pub async fn detect_receive_tx_cancel() -> anyhow::Result<()> {
7878
// address.
7979
let undo_send_outputs = [Output::new(
8080
sender_addr,
81-
selected_utxo.amount.to_unsigned()? - UNDO_SEND_TX_FEE,
81+
selected_utxo.amount - UNDO_SEND_TX_FEE,
8282
)];
8383
let undo_send_tx = rpc_client
8484
.create_raw_transaction(&inputs, &undo_send_outputs)?

crates/esplora/tests/blocking_ext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bdk_chain::spk_client::{FullScanRequest, SyncRequest};
44
use bdk_chain::spk_txout::SpkTxOutIndex;
55
use bdk_chain::{ConfirmationBlockTime, IndexedTxGraph, TxGraph};
66
use bdk_esplora::EsploraExt;
7-
use bdk_testenv::corepc_node::{Input, Output};
7+
use bdk_testenv::bitcoind::{Input, Output};
88
use bdk_testenv::{anyhow, TestEnv};
99
use esplora_client::{self, Builder};
1010
use std::collections::{BTreeSet, HashSet};
@@ -63,7 +63,7 @@ pub fn detect_receive_tx_cancel() -> anyhow::Result<()> {
6363
// Create and sign the `send_tx` that sends funds to the receiver address.
6464
let send_tx_outputs = [Output::new(
6565
receiver_addr,
66-
selected_utxo.amount.to_unsigned()? - SEND_TX_FEE,
66+
selected_utxo.amount - SEND_TX_FEE,
6767
)];
6868

6969
let send_tx = rpc_client
@@ -79,7 +79,7 @@ pub fn detect_receive_tx_cancel() -> anyhow::Result<()> {
7979
// address.
8080
let undo_send_outputs = [Output::new(
8181
sender_addr,
82-
selected_utxo.amount.to_unsigned()? - UNDO_SEND_TX_FEE,
82+
selected_utxo.amount - UNDO_SEND_TX_FEE,
8383
)];
8484
let undo_send_tx = rpc_client
8585
.create_raw_transaction(&inputs, &undo_send_outputs)?

crates/testenv/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ workspace = true
1717

1818
[dependencies]
1919
bdk_chain = { path = "../chain", version = "0.23.1", default-features = false }
20-
electrsd = { version = "0.36.1", features = [ "legacy" ], default-features = false }
20+
electrsd = { version = "0.38.0", features = [ "legacy" ], default-features = false }
2121
bitcoin = { version = "0.32.0", default-features = false }
2222

2323
[dev-dependencies]
2424
bdk_testenv = { path = "." }
2525

2626
[features]
2727
default = ["std", "download"]
28-
download = ["electrsd/corepc-node_28_2", "electrsd/esplora_a33e97e1"]
28+
download = ["electrsd/bitcoind_download", "electrsd/bitcoind_28_2", "electrsd/esplora_a33e97e1"]
2929
std = ["bdk_chain/std", "bitcoin/rand-std"]
3030
serde = ["bdk_chain/serde"]
3131

crates/testenv/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ use bdk_chain::CheckPoint;
1111
use bitcoin::address::NetworkChecked;
1212
use bitcoin::hex::HexToBytesError;
1313
use core::time::Duration;
14-
use electrsd::corepc_node::mtype::GetBlockTemplate;
15-
use electrsd::corepc_node::{TemplateRequest, TemplateRules};
14+
use electrsd::bitcoind::mtype::GetBlockTemplate;
15+
use electrsd::bitcoind::{TemplateRequest, TemplateRules};
1616

1717
pub use electrsd;
18+
pub use electrsd::bitcoind;
19+
pub use electrsd::bitcoind::anyhow;
1820
pub use electrsd::corepc_client;
19-
pub use electrsd::corepc_node;
20-
pub use electrsd::corepc_node::anyhow;
2121
pub use electrsd::electrum_client;
2222
use electrsd::electrum_client::ElectrumApi;
2323

2424
/// Struct for running a regtest environment with a single `bitcoind` node with an `electrs`
2525
/// instance connected to it.
2626
pub struct TestEnv {
27-
pub bitcoind: electrsd::corepc_node::Node,
27+
pub bitcoind: electrsd::bitcoind::BitcoinD,
2828
pub electrsd: electrsd::ElectrsD,
2929
}
3030

3131
/// Configuration parameters.
3232
#[derive(Debug)]
3333
pub struct Config<'a> {
34-
/// [`corepc_node::Conf`]
35-
pub bitcoind: corepc_node::Conf<'a>,
34+
/// [`bitcoind::Conf`]
35+
pub bitcoind: bitcoind::Conf<'a>,
3636
/// [`electrsd::Conf`]
3737
pub electrsd: electrsd::Conf<'a>,
3838
}
@@ -42,7 +42,7 @@ impl Default for Config<'_> {
4242
/// which is required for testing `bdk_esplora`.
4343
fn default() -> Self {
4444
Self {
45-
bitcoind: corepc_node::Conf::default(),
45+
bitcoind: bitcoind::Conf::default(),
4646
electrsd: {
4747
let mut conf = electrsd::Conf::default();
4848
conf.http_enabled = true;
@@ -88,11 +88,11 @@ impl TestEnv {
8888
pub fn new_with_config(config: Config) -> anyhow::Result<Self> {
8989
let bitcoind_exe = match std::env::var("BITCOIND_EXE") {
9090
Ok(path) => path,
91-
Err(_) => corepc_node::downloaded_exe_path().context(
91+
Err(_) => bitcoind::downloaded_exe_path().context(
9292
"you need to provide an env var BITCOIND_EXE or specify a bitcoind version feature",
9393
)?,
9494
};
95-
let bitcoind = corepc_node::Node::with_conf(bitcoind_exe, &config.bitcoind)?;
95+
let bitcoind = bitcoind::BitcoinD::with_conf(bitcoind_exe, &config.bitcoind)?;
9696

9797
let electrs_exe = match std::env::var("ELECTRS_EXE") {
9898
Ok(path) => path,
@@ -110,7 +110,7 @@ impl TestEnv {
110110
}
111111

112112
/// Exposes the RPC calls from [`corepc_client`].
113-
pub fn rpc_client(&self) -> &corepc_node::Client {
113+
pub fn rpc_client(&self) -> &bitcoind::Client {
114114
&self.bitcoind.client
115115
}
116116

@@ -428,7 +428,7 @@ mod test {
428428
use bdk_chain::bitcoin::opcodes::OP_TRUE;
429429
use bdk_chain::bitcoin::Amount;
430430
use core::time::Duration;
431-
use electrsd::corepc_node::anyhow::Result;
431+
use electrsd::bitcoind::anyhow::Result;
432432
use std::collections::BTreeSet;
433433

434434
/// This checks that reorgs initiated by `bitcoind` is detected by our `electrsd` instance.

0 commit comments

Comments
 (0)