@@ -33,11 +33,20 @@ fn get_short_file_name(filename: &str) -> String {
3333 short_file_name. clone ( ) . to_string ( )
3434}
3535
36+ /// Don't do any config change.
37+ pub fn empty_config_change ( _config : & mut Config ) { }
38+
39+ /// Disable EIP-7610.
40+ pub fn disable_eip7610 ( config : & mut Config ) {
41+ config. eip7610_create_check_storage = false ;
42+ }
43+
3644/// Run tests for specific json file with debug flag
3745pub fn run_file (
3846 filename : & str ,
3947 debug : bool ,
4048 write_failed : Option < & str > ,
49+ config_change : fn ( & mut Config ) ,
4150) -> Result < TestCompletionStatus , Error > {
4251 let test_multi: BTreeMap < String , TestMulti > =
4352 serde_json:: from_reader ( BufReader :: new ( File :: open ( filename) ?) ) ?;
@@ -58,7 +67,14 @@ pub fn run_file(
5867 test. fork, short_file_name, test_name, test. index
5968 ) ;
6069 }
61- match run_test ( filename, & test_name, test. clone ( ) , debug, write_failed) {
70+ match run_test (
71+ filename,
72+ & test_name,
73+ test. clone ( ) ,
74+ debug,
75+ write_failed,
76+ config_change,
77+ ) {
6278 Ok ( ( ) ) => {
6379 tests_status. inc_completed ( ) ;
6480 println ! ( "ok" )
@@ -88,6 +104,7 @@ pub fn run_single(
88104 filename : & str ,
89105 debug : bool ,
90106 write_failed : Option < & str > ,
107+ config_change : fn ( & mut Config ) ,
91108) -> Result < TestCompletionStatus , Error > {
92109 if fs:: metadata ( filename) ?. is_dir ( ) {
93110 let mut tests_status = TestCompletionStatus :: default ( ) ;
@@ -98,13 +115,13 @@ pub fn run_single(
98115
99116 if filename. ends_with ( ".json" ) {
100117 println ! ( "RUN for: {filename}" ) ;
101- tests_status += run_file ( filename, debug, write_failed) ?;
118+ tests_status += run_file ( filename, debug, write_failed, config_change ) ?;
102119 }
103120 }
104121 tests_status. print_total_for_dir ( filename) ;
105122 Ok ( tests_status)
106123 } else {
107- run_file ( filename, debug, write_failed)
124+ run_file ( filename, debug, write_failed, config_change )
108125 }
109126}
110127
@@ -159,11 +176,13 @@ pub fn run_test(
159176 test : TestData ,
160177 debug : bool ,
161178 write_failed : Option < & str > ,
179+ config_change : fn ( & mut Config ) ,
162180) -> Result < ( ) , Error > {
163- let config = match test. fork {
181+ let mut config = match test. fork {
164182 Fork :: Istanbul => Config :: istanbul ( ) ,
165183 _ => return Err ( Error :: UnsupportedFork ) ,
166184 } ;
185+ config_change ( & mut config) ;
167186
168187 if test. post . expect_exception == Some ( TestExpectException :: TR_TypeNotSupported ) {
169188 // The `evm` crate does not understand transaction format, only the `ethereum` crate. So
0 commit comments