From 48751e12e6e28a6cc54e435c6d2e7d90d3527caa Mon Sep 17 00:00:00 2001 From: 0xYYY <0xYYY@pm.me> Date: Thu, 2 Mar 2023 22:11:50 +0800 Subject: [PATCH] fix(config): remove fuzz.max_global_rejects --- config/src/fuzz.rs | 3 --- config/src/lib.rs | 4 +--- forge/src/lib.rs | 9 +-------- forge/tests/it/config.rs | 1 - 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/config/src/fuzz.rs b/config/src/fuzz.rs index 111409bd091b..fefb635ea9d6 100644 --- a/config/src/fuzz.rs +++ b/config/src/fuzz.rs @@ -14,8 +14,6 @@ pub struct FuzzConfig { /// `max_local_rejects` option isn't exposed here since we're not using /// `prop_filter`. pub max_test_rejects: u32, - /// Being deprecated in favor of `max_test_rejects`. Will be removed in future versions. - pub max_global_rejects: u32, /// Optional seed for the fuzzing RNG algorithm #[serde( deserialize_with = "ethers_core::types::serde_helpers::deserialize_stringified_numeric_opt" @@ -35,7 +33,6 @@ impl Default for FuzzConfig { FuzzConfig { runs: 256, max_test_rejects: 65536, - max_global_rejects: 65536, seed: None, dictionary_weight: 40, include_storage: true, diff --git a/config/src/lib.rs b/config/src/lib.rs index fe9888940cfa..58199450f378 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -376,9 +376,7 @@ pub static STANDALONE_FALLBACK_SECTIONS: Lazy> = Lazy::new(|| { - HashMap::from([("fuzz.max_global_rejects".into(), "fuzz.max_test_rejects".into())]) -}); +pub static DEPRECATIONS: Lazy> = Lazy::new(|| HashMap::from([])); impl Config { /// The default profile: "default" diff --git a/forge/src/lib.rs b/forge/src/lib.rs index fef9b4f40875..c6172b084294 100644 --- a/forge/src/lib.rs +++ b/forge/src/lib.rs @@ -42,18 +42,11 @@ impl TestOptions { } pub fn fuzzer_with_cases(&self, cases: u32) -> TestRunner { - let max_global_rejects = if self.fuzz.max_test_rejects != - foundry_config::FuzzConfig::default().max_test_rejects - { - self.fuzz.max_test_rejects - } else { - self.fuzz.max_global_rejects - }; // TODO: Add Options to modify the persistence let cfg = proptest::test_runner::Config { failure_persistence: None, cases, - max_global_rejects, + max_global_rejects: self.fuzz.max_test_rejects, ..Default::default() }; diff --git a/forge/tests/it/config.rs b/forge/tests/it/config.rs index a68a23b8c677..a216a6a14d13 100644 --- a/forge/tests/it/config.rs +++ b/forge/tests/it/config.rs @@ -97,7 +97,6 @@ pub static TEST_OPTS: TestOptions = TestOptions { fuzz: FuzzConfig { runs: 256, max_test_rejects: 65536, - max_global_rejects: 65536, seed: None, include_storage: true, include_push_bytes: true,