Skip to content

Commit

Permalink
Upgrade EVMC to version 7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Nov 8, 2019
1 parent b15dd08 commit 58da353
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/evmone/analysis.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct execution_state
const uint8_t* code = nullptr;
size_t code_size = 0;

evmc::HostContext host{nullptr};
evmc::HostContext host;

evmc_revision rev = {};

Expand Down
6 changes: 3 additions & 3 deletions lib/evmone/execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace evmone
{
evmc_result execute(evmc_vm* /*unused*/, evmc_host_context* ctx, evmc_revision rev,
const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept
evmc_result execute(evmc_vm* /*unused*/, const evmc_host_interface* host, evmc_host_context* ctx,
evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept
{
auto analysis = analyze(rev, code, code_size);

Expand All @@ -18,7 +18,7 @@ evmc_result execute(evmc_vm* /*unused*/, evmc_host_context* ctx, evmc_revision r
state->msg = msg;
state->code = code;
state->code_size = code_size;
state->host = evmc::HostContext{ctx};
state->host = evmc::HostContext{host, ctx};
state->gas_left = msg->gas;
state->rev = rev;

Expand Down
4 changes: 2 additions & 2 deletions lib/evmone/execution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

namespace evmone
{
evmc_result execute(evmc_vm* vm, evmc_host_context* ctx, evmc_revision rev, const evmc_message* msg,
const uint8_t* code, size_t code_size) noexcept;
evmc_result execute(evmc_vm* vm, const evmc_host_interface* host, evmc_host_context* ctx,
evmc_revision rev, const evmc_message* msg, const uint8_t* code, size_t code_size) noexcept;
} // namespace evmone
3 changes: 1 addition & 2 deletions test/bench/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ inline evmc::result execute(bytes_view code, bytes_view input) noexcept
msg.gas = gas_limit;
msg.input_data = input.data();
msg.input_size = input.size();
auto null_ctx = evmc_host_context{};
return vm.execute(null_ctx, EVMC_CONSTANTINOPLE, msg, code.data(), code.size());
return vm.execute(EVMC_CONSTANTINOPLE, msg, code.data(), code.size());
}

void execute(State& state, bytes_view code, bytes_view input) noexcept
Expand Down

0 comments on commit 58da353

Please sign in to comment.