diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index 261e5593b5b..8ce59597d84 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -502,7 +502,7 @@ where C::Target: chain::Filter, self.event_notifier.notify(); } - #[cfg(any(test, fuzzing, feature = "_test_utils"))] + #[cfg(any(test, feature = "_test_utils"))] pub fn get_and_clear_pending_events(&self) -> Vec { use crate::events::EventsProvider; let events = core::cell::RefCell::new(Vec::new()); diff --git a/lightning/src/lib.rs b/lightning/src/lib.rs index cea15b21ad2..cf0a04aab08 100644 --- a/lightning/src/lib.rs +++ b/lightning/src/lib.rs @@ -38,7 +38,7 @@ //! * `max_level_trace` #![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), deny(missing_docs))] -#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), forbid(unsafe_code))] +#![cfg_attr(not(any(test, feature = "_test_utils")), forbid(unsafe_code))] // Prefix these with `rustdoc::` when we update our MSRV to be >= 1.52 to remove warnings. #![deny(broken_intra_doc_links)] @@ -67,7 +67,7 @@ extern crate bitcoin; extern crate core; #[cfg(any(test, feature = "_test_utils"))] extern crate hex; -#[cfg(any(test, fuzzing, feature = "_test_utils"))] extern crate regex; +#[cfg(any(test, feature = "_test_utils"))] extern crate regex; #[cfg(not(feature = "std"))] extern crate core2; diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 595fad60ff2..7bcc75c01c3 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -6171,7 +6171,7 @@ where inflight_htlcs } - #[cfg(any(test, fuzzing, feature = "_test_utils"))] + #[cfg(any(test, feature = "_test_utils"))] pub fn get_and_clear_pending_events(&self) -> Vec { let events = core::cell::RefCell::new(Vec::new()); let event_handler = |event: events::Event| events.borrow_mut().push(event); diff --git a/lightning/src/util/mod.rs b/lightning/src/util/mod.rs index 3dbf4f89634..dd9d2744e1c 100644 --- a/lightning/src/util/mod.rs +++ b/lightning/src/util/mod.rs @@ -50,11 +50,11 @@ pub(crate) mod crypto; pub mod logger; pub mod config; -#[cfg(any(test, fuzzing, feature = "_test_utils"))] +#[cfg(any(test, feature = "_test_utils"))] pub mod test_utils; /// impls of traits that add exra enforcement on the way they're called. Useful for detecting state /// machine errors and used in fuzz targets and tests. -#[cfg(any(test, fuzzing, feature = "_test_utils"))] +#[cfg(any(test, feature = "_test_utils"))] pub mod enforcing_trait_impls; diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index fe61e9c7214..24979036ee3 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -45,6 +45,7 @@ use bitcoin::secp256k1::{SecretKey, PublicKey, Secp256k1, ecdsa::Signature, Scal use bitcoin::secp256k1::ecdh::SharedSecret; use bitcoin::secp256k1::ecdsa::RecoverableSignature; +#[cfg(any(test, feature = "_test_utils"))] use regex; use crate::io; @@ -738,6 +739,7 @@ impl TestLogger { /// 1. belong to the specified module and /// 2. match the given regex pattern. /// Assert that the number of occurrences equals the given `count` + #[cfg(any(test, feature = "_test_utils"))] pub fn assert_log_regex(&self, module: &str, pattern: regex::Regex, count: usize) { let log_entries = self.lines.lock().unwrap(); let l: usize = log_entries.iter().filter(|&(&(ref m, ref l), _c)| {