-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Function that translates the name of the test fork to the EVM revisio…
…n (to_rev) moved to utils.cpp
- Loading branch information
Showing
3 changed files
with
54 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ namespace evmone::test | |
|
||
namespace | ||
{ | ||
|
||
struct EOFValidationTest | ||
{ | ||
struct Case | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// evmone: Fast Ethereum Virtual Machine implementation | ||
// Copyright 2023 The evmone Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "utils.hpp" | ||
|
||
namespace evmone::test | ||
{ | ||
|
||
/// Translates tests fork name to EVM revision | ||
evmc_revision to_rev(std::string_view s) | ||
{ | ||
if (s == "Frontier") | ||
return EVMC_FRONTIER; | ||
if (s == "Homestead") | ||
return EVMC_HOMESTEAD; | ||
if (s == "EIP150") | ||
return EVMC_TANGERINE_WHISTLE; | ||
if (s == "EIP158") | ||
return EVMC_SPURIOUS_DRAGON; | ||
if (s == "Byzantium") | ||
return EVMC_BYZANTIUM; | ||
if (s == "Constantinople") | ||
return EVMC_CONSTANTINOPLE; | ||
if (s == "ConstantinopleFix") | ||
return EVMC_PETERSBURG; | ||
if (s == "Istanbul") | ||
return EVMC_ISTANBUL; | ||
if (s == "Berlin") | ||
return EVMC_BERLIN; | ||
if (s == "London") | ||
return EVMC_LONDON; | ||
if (s == "Merge") | ||
return EVMC_PARIS; | ||
if (s == "Merge+3855") // PUSH0 | ||
return EVMC_SHANGHAI; | ||
if (s == "Shanghai") | ||
return EVMC_SHANGHAI; | ||
if (s == "Cancun") | ||
return EVMC_CANCUN; | ||
if (s == "Prague") | ||
return EVMC_PRAGUE; | ||
throw std::invalid_argument{"unknown revision: " + std::string{s}}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters