diff --git a/test/state/host.cpp b/test/state/host.cpp index 5e4f405275..31f662df50 100644 --- a/test/state/host.cpp +++ b/test/state/host.cpp @@ -315,8 +315,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); - // Copy of the code. Revert will invalidate the account. - const auto code = dst_acc != nullptr ? dst_acc->code : bytes{}; + const auto code = dst_acc != nullptr ? bytes_view{dst_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 3eaaf7aa0f..0d5043de7a 100644 --- a/test/state/state.cpp +++ b/test/state/state.cpp @@ -393,7 +393,7 @@ std::variant transition(State& state, const gas_used -= refund; assert(gas_used > 0); - state.get(tx.sender).balance += tx_max_cost - gas_used * effective_gas_price; + sender_acc.balance += tx_max_cost - gas_used * effective_gas_price; state.touch(block.coinbase).balance += gas_used * priority_gas_price; // Apply destructs.