File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,9 @@ impl SnapshotArgs {
94
94
}
95
95
96
96
pub async fn run ( mut self ) -> Result < ( ) > {
97
- // Set fuzz seed so gas snapshots are deterministic
97
+ // Set fuzz seed and disable fuzzing from state so gas snapshots are deterministic.
98
98
self . test . fuzz_seed = Some ( U256 :: from_be_bytes ( STATIC_FUZZ_SEED ) ) ;
99
+ self . test . fuzz_dictionary_weight = Some ( 0 ) ;
99
100
100
101
let outcome = self . test . execute_tests ( ) . await ?;
101
102
outcome. ensure_ok ( ) ?;
Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ pub struct TestArgs {
102
102
#[ arg( long) ]
103
103
pub fuzz_seed : Option < U256 > ,
104
104
105
+ /// Set fuzz dictionary weight.
106
+ #[ arg( long) ]
107
+ pub fuzz_dictionary_weight : Option < u32 > ,
108
+
105
109
#[ arg( long, env = "FOUNDRY_FUZZ_RUNS" , value_name = "RUNS" ) ]
106
110
pub fuzz_runs : Option < u64 > ,
107
111
@@ -227,6 +231,11 @@ impl TestArgs {
227
231
config. invariant . gas_report_samples = 0 ;
228
232
}
229
233
234
+ // Set fuzz dictionary weight if specified as arg.
235
+ if let Some ( dictionary_weight) = self . fuzz_dictionary_weight {
236
+ config. fuzz . dictionary . dictionary_weight = dictionary_weight;
237
+ }
238
+
230
239
// Set up the project.
231
240
let mut project = config. project ( ) ?;
232
241
You can’t perform that action at this time.
0 commit comments