Skip to content

Commit 773e8ad

Browse files
Merge pull request #2365 from TheBlueMatt/2023-06-fix-fuzz-dep
Ensure we build if a downstream crate sets `--cfg=fuzzing`
2 parents 15b1c9b + e49a1ba commit 773e8ad

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ where C::Target: chain::Filter,
502502
self.event_notifier.notify();
503503
}
504504

505-
#[cfg(any(test, fuzzing, feature = "_test_utils"))]
505+
#[cfg(any(test, feature = "_test_utils"))]
506506
pub fn get_and_clear_pending_events(&self) -> Vec<events::Event> {
507507
use crate::events::EventsProvider;
508508
let events = core::cell::RefCell::new(Vec::new());

lightning/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! * `max_level_trace`
3939
4040
#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), deny(missing_docs))]
41-
#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), forbid(unsafe_code))]
41+
#![cfg_attr(not(any(test, feature = "_test_utils")), forbid(unsafe_code))]
4242

4343
// Prefix these with `rustdoc::` when we update our MSRV to be >= 1.52 to remove warnings.
4444
#![deny(broken_intra_doc_links)]
@@ -67,7 +67,7 @@ extern crate bitcoin;
6767
extern crate core;
6868

6969
#[cfg(any(test, feature = "_test_utils"))] extern crate hex;
70-
#[cfg(any(test, fuzzing, feature = "_test_utils"))] extern crate regex;
70+
#[cfg(any(test, feature = "_test_utils"))] extern crate regex;
7171

7272
#[cfg(not(feature = "std"))] extern crate core2;
7373

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6241,7 +6241,7 @@ where
62416241
inflight_htlcs
62426242
}
62436243

6244-
#[cfg(any(test, fuzzing, feature = "_test_utils"))]
6244+
#[cfg(any(test, feature = "_test_utils"))]
62456245
pub fn get_and_clear_pending_events(&self) -> Vec<events::Event> {
62466246
let events = core::cell::RefCell::new(Vec::new());
62476247
let event_handler = |event: events::Event| events.borrow_mut().push(event);

lightning/src/util/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ pub(crate) mod crypto;
5050
pub mod logger;
5151
pub mod config;
5252

53-
#[cfg(any(test, fuzzing, feature = "_test_utils"))]
53+
#[cfg(any(test, feature = "_test_utils"))]
5454
pub mod test_utils;
5555

5656
/// impls of traits that add exra enforcement on the way they're called. Useful for detecting state
5757
/// machine errors and used in fuzz targets and tests.
58-
#[cfg(any(test, fuzzing, feature = "_test_utils"))]
58+
#[cfg(any(test, feature = "_test_utils"))]
5959
pub mod enforcing_trait_impls;
6060

lightning/src/util/test_utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use bitcoin::secp256k1::{SecretKey, PublicKey, Secp256k1, ecdsa::Signature, Scal
4545
use bitcoin::secp256k1::ecdh::SharedSecret;
4646
use bitcoin::secp256k1::ecdsa::RecoverableSignature;
4747

48+
#[cfg(any(test, feature = "_test_utils"))]
4849
use regex;
4950

5051
use crate::io;
@@ -738,6 +739,7 @@ impl TestLogger {
738739
/// 1. belong to the specified module and
739740
/// 2. match the given regex pattern.
740741
/// Assert that the number of occurrences equals the given `count`
742+
#[cfg(any(test, feature = "_test_utils"))]
741743
pub fn assert_log_regex(&self, module: &str, pattern: regex::Regex, count: usize) {
742744
let log_entries = self.lines.lock().unwrap();
743745
let l: usize = log_entries.iter().filter(|&(&(ref m, ref l), _c)| {

0 commit comments

Comments
 (0)