Skip to content

Commit

Permalink
Simplify eosevm abort function
Browse files Browse the repository at this point in the history
  • Loading branch information
elmato committed Jan 18, 2024
1 parent 8b8e25e commit d0def37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
18 changes: 1 addition & 17 deletions eosevm/assert.hpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
#pragma once
#ifdef ANTELOPE
#include <eosio/eosio.hpp>
#else
#include <silkworm/silkworm/core/common/assert.hpp>
#endif

namespace eosevm {

static void abort(const char* msg) {
#ifdef ANTELOPE
eosio::check(false, msg);
#else
silkworm::abort_due_to_assertion_failure(msg, __FILE__, __LINE__);
#endif
}

}
#define EOSEVM_ABORT(msg) silkworm::abort_due_to_assertion_failure(msg, __FILE__, __LINE__)
2 changes: 1 addition & 1 deletion eosevm/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inline evmc_revision version_to_evmc_revision(uint64_t version) {
case 1: return EVMC_ISTANBUL;
}
auto msg = "Unknown EOSEVM version: " + std::to_string(version);
eosevm::abort(msg.c_str());
EOSEVM_ABORT(msg.c_str());
return static_cast<evmc_revision>(0);
}

Expand Down

0 comments on commit d0def37

Please sign in to comment.