diff --git a/eosevm/assert.hpp b/eosevm/assert.hpp new file mode 100644 index 00000000..feedac40 --- /dev/null +++ b/eosevm/assert.hpp @@ -0,0 +1,2 @@ +#pragma once +#define EOSEVM_ABORT(msg) silkworm::abort_due_to_assertion_failure(msg, __FILE__, __LINE__) diff --git a/eosevm/version.hpp b/eosevm/version.hpp index 5e027b54..3e123f5a 100644 --- a/eosevm/version.hpp +++ b/eosevm/version.hpp @@ -2,9 +2,11 @@ #include #include - +#include namespace eosevm { +static constexpr uint64_t max_eos_evm_version = 1; + using NonceType=silkworm::BlockHeader::NonceType; inline NonceType version_to_nonce(uint64_t version) { @@ -22,8 +24,10 @@ inline evmc_revision version_to_evmc_revision(uint64_t version) { switch (version) { case 0: return EVMC_ISTANBUL; case 1: return EVMC_ISTANBUL; - default: return EVMC_ISTANBUL; } + auto msg = "Unknown EOSEVM version: " + std::to_string(version); + EOSEVM_ABORT(msg.c_str()); + return static_cast(0); } } // namespace eosevm \ No newline at end of file