Skip to content

Commit c4b6873

Browse files
committed
build(testenv): modify default feature
The feature now depends on `bdk_chain/default`. Now default feature gates the persistence test utils rather than std.
1 parent fd9429c commit c4b6873

File tree

8 files changed

+9
-15
lines changed

8 files changed

+9
-15
lines changed

crates/bitcoind_rpc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bdk_core = { path = "../core", version = "0.6.1", default-features = false }
2222

2323
[dev-dependencies]
2424
bdk_bitcoind_rpc = { path = "." }
25-
bdk_testenv = { path = "../testenv" }
25+
bdk_testenv = { path = "../testenv", features = ["download"]}
2626
bdk_chain = { path = "../chain" }
2727

2828
[features]

crates/chain/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rusqlite = { version = "0.31.0", features = ["bundled"], optional = true }
2727
[dev-dependencies]
2828
rand = "0.8"
2929
proptest = "1.2.0"
30-
bdk_testenv = { path = "../testenv" }
30+
bdk_testenv = { path = "../testenv", features = ["download"]}
3131
criterion = { version = "0.2" }
3232

3333
[features]

crates/electrum/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bdk_core = { path = "../core", version = "0.6.1" }
1717
electrum-client = { version = "0.24.0", features = [ "proxy" ], default-features = false }
1818

1919
[dev-dependencies]
20-
bdk_testenv = { path = "../testenv" }
20+
bdk_testenv = { path = "../testenv", features = ["download"]}
2121
bdk_chain = { path = "../chain" }
2222
criterion = { version = "0.2" }
2323

crates/esplora/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ futures = { version = "0.3.26", optional = true }
2323
[dev-dependencies]
2424
esplora-client = { version = "0.12.0" }
2525
bdk_chain = { path = "../chain" }
26-
bdk_testenv = { path = "../testenv" }
26+
bdk_testenv = { path = "../testenv", features = ["download"]}
2727
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
2828

2929
[features]

crates/testenv/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ tempfile = "3.20.0"
2525
bdk_testenv = { path = "." }
2626

2727
[features]
28-
default = ["std" , "download", "miniscript"]
29-
miniscript = ["std", "bdk_chain/default"]
28+
default = ["bdk_chain/default"]
3029
download = ["electrsd/bitcoind_25_0", "electrsd/esplora_a33e97e1"]
3130
std = ["bdk_chain/std"]
3231
serde = ["bdk_chain/serde"]

crates/testenv/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
22

3-
#[cfg(feature = "std")]
3+
#[cfg(feature = "default")]
44
pub mod persist_test_utils;
55
pub mod utils;
66

crates/testenv/src/persist_test_utils.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! This module provides utility functions for testing custom persistence backends.
22
use crate::{block_id, hash};
3-
#[cfg(feature = "miniscript")]
43
use bdk_chain::{
54
bitcoin::ScriptBuf, indexer::keychain_txout, DescriptorExt, DescriptorId, SpkIterator,
65
};
@@ -14,7 +13,6 @@ use std::sync::Arc;
1413

1514
use crate::utils::{create_test_tx, create_txout};
1615

17-
#[cfg(feature = "miniscript")]
1816
use crate::utils::{parse_descriptor, spk_at_index};
1917

2018
const ADDRS: [&str; 2] = [
@@ -127,7 +125,6 @@ pub fn persist_txgraph_changeset<Store, CreateStore, Initialize, Persist>(
127125
/// We create a dummy [`keychain_txout::ChangeSet`], persist it and check if loaded `ChangeSet`
128126
/// matches the persisted one. We then create another such dummy `ChangeSet`, persist it and load it
129127
/// to check if merged `ChangeSet` is returned.
130-
#[cfg(feature = "miniscript")]
131128
pub fn persist_indexer_changeset<Store, CreateStore, Initialize, Persist>(
132129
file_name: &str,
133130
create_store: CreateStore,
@@ -748,7 +745,6 @@ pub fn persist_anchors<Store, CreateStore, Initialize, Persist>(
748745
/// We create a dummy [`keychain_txout::ChangeSet`] with only `last_revealed` field populated,
749746
/// persist it and check if loaded `ChangeSet` matches the persisted one. We then create another
750747
/// such dummy `ChangeSet`, persist it and load it to check if merged `ChangeSet` is returned.
751-
#[cfg(feature = "miniscript")]
752748
pub fn persist_last_revealed<Store, CreateStore, Initialize, Persist>(
753749
file_name: &str,
754750
create_store: CreateStore,
@@ -805,7 +801,6 @@ pub fn persist_last_revealed<Store, CreateStore, Initialize, Persist>(
805801
/// We create a dummy [`keychain_txout::ChangeSet`] with only `spk_cache` field populated, persist
806802
/// it and check if loaded `ChangeSet` matches the persisted one. We then create another such dummy
807803
/// `ChangeSet`, persist it and load it to check if merged `ChangeSet` is returned.
808-
#[cfg(feature = "miniscript")]
809804
pub fn persist_spk_cache<Store, CreateStore, Initialize, Persist>(
810805
file_name: &str,
811806
create_store: CreateStore,

crates/testenv/src/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use bdk_chain::bitcoin::{
33
};
44
use core::str::FromStr;
55

6-
#[cfg(feature = "miniscript")]
6+
#[cfg(feature = "default")]
77
use bdk_chain::miniscript::{descriptor::KeyMap, Descriptor, DescriptorPublicKey};
88

99
#[allow(unused_macros)]
@@ -128,7 +128,7 @@ pub fn create_test_tx(
128128
}
129129

130130
/// Generates `script_pubkey` corresponding to `index` on keychain of `descriptor`.
131-
#[cfg(feature = "miniscript")]
131+
#[cfg(feature = "default")]
132132
pub fn spk_at_index(
133133
descriptor: &Descriptor<DescriptorPublicKey>,
134134
index: u32,
@@ -141,7 +141,7 @@ pub fn spk_at_index(
141141
}
142142

143143
/// Parses a descriptor string.
144-
#[cfg(feature = "miniscript")]
144+
#[cfg(feature = "default")]
145145
pub fn parse_descriptor(descriptor: &str) -> (Descriptor<DescriptorPublicKey>, KeyMap) {
146146
use bdk_chain::bitcoin::key::Secp256k1;
147147
let secp = Secp256k1::signing_only();

0 commit comments

Comments
 (0)