File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
crates/evm/fuzz/src/strategies Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -97,9 +97,20 @@ fn select_random_sender(
9797 100 - dictionary_weight => fuzz_param( & alloy_dyn_abi:: DynSolType :: Address ) ,
9898 dictionary_weight => fuzz_param_from_state( & alloy_dyn_abi:: DynSolType :: Address , fuzz_state) ,
9999 ]
100- . prop_map ( move |addr| addr. as_address ( ) . unwrap ( ) )
101- // Too many exclusions can slow down testing.
102- . prop_filter ( "excluded sender" , move |addr| !senders. excluded . contains ( addr) )
100+ . prop_map ( move |addr| {
101+ let mut addr = addr. as_address ( ) . unwrap ( ) ;
102+ // Make sure the selected address is not in the list of excluded senders.
103+ // We don't use proptest's filter to avoid reaching the `PROPTEST_MAX_LOCAL_REJECTS`
104+ // max rejects and exiting test before all runs completes.
105+ // See <https://github.com/foundry-rs/foundry/issues/11369>.
106+ loop {
107+ if !senders. excluded . contains ( & addr) {
108+ break ;
109+ }
110+ addr = Address :: random ( ) ;
111+ }
112+ addr
113+ } )
103114 . boxed ( )
104115 }
105116}
You can’t perform that action at this time.
0 commit comments