diff --git a/test/statetest/CMakeLists.txt b/test/statetest/CMakeLists.txt index fb68c46593..0de4004010 100644 --- a/test/statetest/CMakeLists.txt +++ b/test/statetest/CMakeLists.txt @@ -18,6 +18,7 @@ target_sources( add_executable(evmone-statetest) target_link_libraries(evmone-statetest PRIVATE evmone::statetestutils evmone GTest::gtest) +target_include_directories(evmone-statetest PRIVATE ${evmone_private_include_dir}) target_sources( evmone-statetest PRIVATE statetest.cpp diff --git a/test/statetest/statetest_runner.cpp b/test/statetest/statetest_runner.cpp index 53e9195e9b..f8e674fd24 100644 --- a/test/statetest/statetest_runner.cpp +++ b/test/statetest/statetest_runner.cpp @@ -5,6 +5,7 @@ #include "../state/mpt_hash.hpp" #include "../state/rlp.hpp" #include "statetest.hpp" +#include #include namespace evmone::test @@ -25,6 +26,14 @@ void run_state_test(const StateTransitionTest& test, evmc::VM& vm) const auto tx = test.multi_tx.get(expected.indexes); auto state = test.pre_state; + for (const auto& [add, acc] : state.get_accounts()) + if (is_eof_container(acc.code)) + if (const auto result = validate_eof(rev, acc.code); + result != EOFValidationError::success) + throw std::invalid_argument( + "deployed contract code validation failure: " + hex0x(add) + ": " + + get_error_message(result).data()); + const auto res = state::transition(state, test.block, tx, rev, vm); if (holds_alternative(res)) EXPECT_EQ(logs_hash(get(res).logs), expected.logs_hash);