diff --git a/bin/evmbin/src/main.rs b/bin/evmbin/src/main.rs index c6a7f987e..343f5118b 100644 --- a/bin/evmbin/src/main.rs +++ b/bin/evmbin/src/main.rs @@ -46,6 +46,8 @@ use bytes::Bytes; use docopt::Docopt; use ethcore::{json_tests, spec, TrieSpec}; use ethereum_types::{Address, U256}; +use ethjson::spec::ForkSpec; +use evm::EnvInfo; use rustc_hex::FromHex; use std::{fmt, fs, path::PathBuf, sync::Arc}; use vm::{ActionParams, CallType}; @@ -192,10 +194,18 @@ fn run_state_test(args: Args) { } let multitransaction = test.transaction; - let env_info = test.env.into(); + let env_info: EnvInfo = test.env.into(); let pre = test.pre_state.into(); for (spec, states) in test.post_states { + //hardcode base fee for part of the london tests, that miss base fee field in env + let mut test_env = env_info.clone(); + if spec >= ForkSpec::London { + if test_env.base_fee.is_none() { + test_env.base_fee = Some(0x0a.into()); + } + } + if let Some(false) = only_chain .as_ref() .map(|only_chain| &format!("{:?}", spec).to_lowercase() == only_chain) @@ -218,7 +228,7 @@ fn run_state_test(args: Args) { &spec, &pre, post_root, - &env_info, + &test_env, transaction, display::json::Informant::new(config), trie_spec, @@ -231,7 +241,7 @@ fn run_state_test(args: Args) { &spec, &pre, post_root, - &env_info, + &test_env, transaction, display::std_json::Informant::err_only(config), trie_spec, @@ -243,7 +253,7 @@ fn run_state_test(args: Args) { &spec, &pre, post_root, - &env_info, + &test_env, transaction, display::std_json::Informant::out_only(config), trie_spec, @@ -255,7 +265,7 @@ fn run_state_test(args: Args) { &spec, &pre, post_root, - &env_info, + &test_env, transaction, display::std_json::Informant::new_default(config), trie_spec, @@ -268,7 +278,7 @@ fn run_state_test(args: Args) { &spec, &pre, post_root, - &env_info, + &test_env, transaction, display::simple::Informant::new(config), trie_spec,