diff --git a/test/state/host.cpp b/test/state/host.cpp index b612d387ec..9ff39047b0 100644 --- a/test/state/host.cpp +++ b/test/state/host.cpp @@ -376,9 +376,8 @@ evmc::Result Host::execute_message(const evmc_message& msg) noexcept m_state.journal_create(msg.recipient, exists); } - assert(msg.kind != EVMC_CALL || evmc::address{msg.recipient} == msg.code_address); - auto* const dst_acc = - (msg.kind == EVMC_CALL) ? &m_state.touch(msg.recipient) : m_state.find(msg.code_address); + auto* const dst_acc = &m_state.touch(msg.recipient); + const auto* const code_acc = m_state.find(msg.code_address); if (msg.kind == EVMC_CALL && !evmc::is_zero(msg.value)) { @@ -395,7 +394,7 @@ evmc::Result Host::execute_message(const evmc_message& msg) noexcept if (is_precompile(m_rev, msg.code_address)) return call_precompile(m_rev, msg); - const auto code = dst_acc != nullptr ? bytes_view{dst_acc->code} : bytes_view{}; + const auto code = code_acc != nullptr ? bytes_view{code_acc->code} : bytes_view{}; return m_vm.execute(*this, m_rev, msg, code.data(), code.size()); } diff --git a/test/state/state.cpp b/test/state/state.cpp index cb49c4418a..2e8dfd7427 100644 --- a/test/state/state.cpp +++ b/test/state/state.cpp @@ -567,8 +567,6 @@ std::variant transition(State& state, const std::copy_n(message.code_address.bytes, std::size(message.code_address.bytes), &to_ptr->code[std::size(DELEGATION_MAGIC)]); - - message.kind = EVMC_DELEGATECALL; } }