From 1d294b734dd6f4639075cba271e2b40f437f998f Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Wed, 8 May 2024 14:36:52 +0200 Subject: [PATCH] fix: Run tests only if the miniscript feature is.. ..enabled, enable it by default --- crates/chain/Cargo.toml | 2 +- crates/chain/tests/common/mod.rs | 2 ++ crates/chain/tests/common/tx_template.rs | 2 ++ crates/chain/tests/test_indexed_tx_graph.rs | 2 ++ crates/chain/tests/test_local_chain.rs | 2 ++ crates/chain/tests/test_tx_graph.rs | 2 ++ crates/chain/tests/test_tx_graph_conflicts.rs | 2 ++ 7 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/chain/Cargo.toml b/crates/chain/Cargo.toml index 7db69746..1f4ca9c5 100644 --- a/crates/chain/Cargo.toml +++ b/crates/chain/Cargo.toml @@ -26,6 +26,6 @@ rand = "0.8" proptest = "1.2.0" [features] -default = ["std"] +default = ["std", "miniscript"] std = ["bitcoin/std", "miniscript?/std"] serde = ["serde_crate", "bitcoin/serde", "miniscript?/serde"] diff --git a/crates/chain/tests/common/mod.rs b/crates/chain/tests/common/mod.rs index 2440b585..3fad37f9 100644 --- a/crates/chain/tests/common/mod.rs +++ b/crates/chain/tests/common/mod.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + mod tx_template; #[allow(unused_imports)] pub use tx_template::*; diff --git a/crates/chain/tests/common/tx_template.rs b/crates/chain/tests/common/tx_template.rs index 04fec35a..42bc0f79 100644 --- a/crates/chain/tests/common/tx_template.rs +++ b/crates/chain/tests/common/tx_template.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + use rand::distributions::{Alphanumeric, DistString}; use std::collections::HashMap; diff --git a/crates/chain/tests/test_indexed_tx_graph.rs b/crates/chain/tests/test_indexed_tx_graph.rs index e9676756..32816337 100644 --- a/crates/chain/tests/test_indexed_tx_graph.rs +++ b/crates/chain/tests/test_indexed_tx_graph.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + #[macro_use] mod common; diff --git a/crates/chain/tests/test_local_chain.rs b/crates/chain/tests/test_local_chain.rs index cff4a8e7..6819e3da 100644 --- a/crates/chain/tests/test_local_chain.rs +++ b/crates/chain/tests/test_local_chain.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + use std::ops::{Bound, RangeBounds}; use bdk_chain::{ diff --git a/crates/chain/tests/test_tx_graph.rs b/crates/chain/tests/test_tx_graph.rs index 1c7a90f7..26e29ed1 100644 --- a/crates/chain/tests/test_tx_graph.rs +++ b/crates/chain/tests/test_tx_graph.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + #[macro_use] mod common; use bdk_chain::tx_graph::CalculateFeeError; diff --git a/crates/chain/tests/test_tx_graph_conflicts.rs b/crates/chain/tests/test_tx_graph_conflicts.rs index 96d7b49f..0856eec9 100644 --- a/crates/chain/tests/test_tx_graph_conflicts.rs +++ b/crates/chain/tests/test_tx_graph_conflicts.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "miniscript")] + #[macro_use] mod common;