From c07b4de9831da640d5593fe8df9334cd8041c108 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 25 Nov 2020 17:50:38 -0500 Subject: [PATCH] Expose test_utils to fuzztarget (in addition to _test_utils feature) --- lightning/Cargo.toml | 2 +- lightning/src/chain/channelmonitor.rs | 4 ++-- lightning/src/lib.rs | 2 +- lightning/src/util/mod.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lightning/Cargo.toml b/lightning/Cargo.toml index 2d7d95dd..016399f8 100644 --- a/lightning/Cargo.toml +++ b/lightning/Cargo.toml @@ -11,7 +11,7 @@ Still missing tons of error-handling. See GitHub issues for suggested projects i """ [features] -fuzztarget = ["bitcoin/fuzztarget"] +fuzztarget = ["bitcoin/fuzztarget", "regex"] # Internal test utilities exposed to other repo crates _test_utils = ["hex", "regex"] # Unlog messages superior at targeted level. diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 52783761..fe03375c 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -56,7 +56,7 @@ use std::io::Error; /// An update generated by the underlying Channel itself which contains some new information the /// ChannelMonitor should be made aware of. -#[cfg_attr(any(test, feature = "_test_utils"), derive(PartialEq))] +#[cfg_attr(any(test, feature = "fuzztarget", feature = "_test_utils"), derive(PartialEq))] #[derive(Clone)] #[must_use] pub struct ChannelMonitorUpdate { @@ -485,7 +485,7 @@ enum OnchainEvent { const SERIALIZATION_VERSION: u8 = 1; const MIN_SERIALIZATION_VERSION: u8 = 1; -#[cfg_attr(any(test, feature = "_test_utils"), derive(PartialEq))] +#[cfg_attr(any(test, feature = "fuzztarget", feature = "_test_utils"), derive(PartialEq))] #[derive(Clone)] pub(crate) enum ChannelMonitorUpdateStep { LatestHolderCommitmentTXInfo { diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index c5d36926..e466205c 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -29,7 +29,7 @@ extern crate bitcoin; #[cfg(any(test, feature = "_test_utils"))] extern crate hex; -#[cfg(any(test, feature = "_test_utils"))] extern crate regex; +#[cfg(any(test, feature = "fuzztarget", feature = "_test_utils"))] extern crate regex; #[macro_use] pub mod util; diff --git a/lightning/src/util/mod.rs b/lightning/src/util/mod.rs index a3cfaa98..57b5f2d7 100644 --- a/lightning/src/util/mod.rs +++ b/lightning/src/util/mod.rs @@ -32,7 +32,7 @@ pub(crate) mod macro_logger; pub mod logger; pub mod config; -#[cfg(any(test, feature = "_test_utils"))] +#[cfg(any(test, feature = "fuzztarget", feature = "_test_utils"))] pub mod test_utils; /// impls of traits that add exra enforcement on the way they're called. Useful for detecting state -- 2.30.2