Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): remove fuzz.max_global_rejects #4466

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions config/src/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,7 @@ pub static STANDALONE_FALLBACK_SECTIONS: Lazy<HashMap<&'static str, &'static str
Lazy::new(|| HashMap::from([("invariant", "fuzz")]));

/// Deprecated keys.
pub static DEPRECATIONS: Lazy<HashMap<String, String>> = Lazy::new(|| {
HashMap::from([("fuzz.max_global_rejects".into(), "fuzz.max_test_rejects".into())])
});
pub static DEPRECATIONS: Lazy<HashMap<String, String>> = Lazy::new(|| HashMap::from([]));

impl Config {
/// The default profile: "default"
Expand Down
9 changes: 1 addition & 8 deletions forge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};

Expand Down
1 change: 0 additions & 1 deletion forge/tests/it/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down