From 41484db2de912b7f11226de025bbe3f59704df2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 28 Jun 2021 13:37:02 +0200 Subject: [PATCH] Add EVMC_LATEST_STABLE_REVISON --- include/evmc/evmc.h | 9 ++++++++- test/tools/CMakeLists.txt | 6 ++++++ tools/evmc/main.cpp | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/evmc/evmc.h b/include/evmc/evmc.h index 20d053194..c0d79d4e7 100644 --- a/include/evmc/evmc.h +++ b/include/evmc/evmc.h @@ -840,7 +840,14 @@ enum evmc_revision EVMC_SHANGHAI = 10, /** The maximum EVM revision supported. */ - EVMC_MAX_REVISION = EVMC_SHANGHAI + EVMC_MAX_REVISION = EVMC_SHANGHAI, + + /** + * The latest known EVM revision with finalized specification. + * + * This is handy for EVM tools to always use the latest revision available. + */ + EVMC_LATEST_STABLE_REVISION = EVMC_LONDON }; diff --git a/test/tools/CMakeLists.txt b/test/tools/CMakeLists.txt index f0cd717e6..69bf6fd22 100644 --- a/test/tools/CMakeLists.txt +++ b/test/tools/CMakeLists.txt @@ -33,6 +33,12 @@ add_evmc_tool_test( "Result: +success[\r\n]+Gas used: +7[\r\n]+Output: +aabbccdd00000000000000000000000000000000000000000000000000000000[\r\n]" ) +add_evmc_tool_test( + default_revision + "--vm $ run 00" + "Executing on London" +) + add_evmc_tool_test( create_return_2 "--vm $ run --create 6960026000526001601ff3600052600a6016f3" diff --git a/tools/evmc/main.cpp b/tools/evmc/main.cpp index 62aaa547c..c6acefdba 100644 --- a/tools/evmc/main.cpp +++ b/tools/evmc/main.cpp @@ -48,7 +48,7 @@ int main(int argc, const char** argv) std::string vm_config; std::string code_arg; int64_t gas = 1000000; - auto rev = EVMC_BERLIN; + auto rev = EVMC_LATEST_STABLE_REVISION; std::string input_arg; auto create = false; auto bench = false;