mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
EVMVersion in langutil namespace instead of solidity
This commit is contained in:
@@ -239,7 +239,7 @@ protected:
|
||||
bytes data;
|
||||
};
|
||||
|
||||
solidity::EVMVersion m_evmVersion;
|
||||
langutil::EVMVersion m_evmVersion;
|
||||
unsigned m_optimizeRuns = 200;
|
||||
bool m_optimize = false;
|
||||
bool m_showMessages = false;
|
||||
|
||||
+3
-3
@@ -59,16 +59,16 @@ Options::Options()
|
||||
parse(suite.argc, suite.argv);
|
||||
}
|
||||
|
||||
dev::solidity::EVMVersion Options::evmVersion() const
|
||||
langutil::EVMVersion Options::evmVersion() const
|
||||
{
|
||||
if (!evmVersionString.empty())
|
||||
{
|
||||
// We do this check as opposed to in the constructor because the BOOST_REQUIRE
|
||||
// macros cannot yet be used in the constructor.
|
||||
auto version = solidity::EVMVersion::fromString(evmVersionString);
|
||||
auto version = langutil::EVMVersion::fromString(evmVersionString);
|
||||
BOOST_REQUIRE_MESSAGE(version, "Invalid EVM version: " + evmVersionString);
|
||||
return *version;
|
||||
}
|
||||
else
|
||||
return dev::solidity::EVMVersion();
|
||||
return langutil::EVMVersion();
|
||||
}
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ struct Options: CommonOptions
|
||||
bool showMessages = false;
|
||||
bool useABIEncoderV2 = false;
|
||||
|
||||
solidity::EVMVersion evmVersion() const;
|
||||
langutil::EVMVersion evmVersion() const;
|
||||
|
||||
static Options const& get();
|
||||
|
||||
|
||||
+4
-4
@@ -237,16 +237,16 @@ string RPCSession::personal_newAccount(string const& _password)
|
||||
void RPCSession::test_setChainParams(vector<string> const& _accounts)
|
||||
{
|
||||
string forks;
|
||||
if (test::Options::get().evmVersion() >= solidity::EVMVersion::tangerineWhistle())
|
||||
if (test::Options::get().evmVersion() >= langutil::EVMVersion::tangerineWhistle())
|
||||
forks += "\"EIP150ForkBlock\": \"0x00\",\n";
|
||||
if (test::Options::get().evmVersion() >= solidity::EVMVersion::spuriousDragon())
|
||||
if (test::Options::get().evmVersion() >= langutil::EVMVersion::spuriousDragon())
|
||||
forks += "\"EIP158ForkBlock\": \"0x00\",\n";
|
||||
if (test::Options::get().evmVersion() >= solidity::EVMVersion::byzantium())
|
||||
if (test::Options::get().evmVersion() >= langutil::EVMVersion::byzantium())
|
||||
{
|
||||
forks += "\"byzantiumForkBlock\": \"0x00\",\n";
|
||||
m_receiptHasStatusField = true;
|
||||
}
|
||||
if (test::Options::get().evmVersion() >= solidity::EVMVersion::constantinople())
|
||||
if (test::Options::get().evmVersion() >= langutil::EVMVersion::constantinople())
|
||||
forks += "\"constantinopleForkBlock\": \"0x00\",\n";
|
||||
static string const c_configString = R"(
|
||||
{
|
||||
|
||||
@@ -762,7 +762,7 @@ BOOST_AUTO_TEST_CASE(complex_struct)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_simple)
|
||||
{
|
||||
if (m_evmVersion == EVMVersion::homestead())
|
||||
if (m_evmVersion == langutil::EVMVersion::homestead())
|
||||
return;
|
||||
|
||||
string sourceCode = R"(
|
||||
@@ -783,7 +783,7 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_simple)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_advanced)
|
||||
{
|
||||
if (m_evmVersion == EVMVersion::homestead())
|
||||
if (m_evmVersion == langutil::EVMVersion::homestead())
|
||||
return;
|
||||
|
||||
string sourceCode = R"(
|
||||
@@ -830,7 +830,7 @@ BOOST_AUTO_TEST_CASE(return_dynamic_types_cross_call_out_of_range)
|
||||
)";
|
||||
BOTH_ENCODERS(
|
||||
compileAndRun(sourceCode, 0, "C");
|
||||
if (m_evmVersion == EVMVersion::homestead())
|
||||
if (m_evmVersion == langutil::EVMVersion::homestead())
|
||||
{
|
||||
ABI_CHECK(callContractFunction("f(uint256)", 0x60), encodeArgs(true));
|
||||
ABI_CHECK(callContractFunction("f(uint256)", 0x7f), encodeArgs(true));
|
||||
|
||||
@@ -3080,7 +3080,7 @@ BOOST_AUTO_TEST_CASE(gasprice)
|
||||
BOOST_AUTO_TEST_CASE(blockhash)
|
||||
{
|
||||
// depending on the aleth version, this test only works for pre-constantinople
|
||||
if (Options::get().evmVersion() < EVMVersion::constantinople())
|
||||
if (Options::get().evmVersion() < langutil::EVMVersion::constantinople())
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
|
||||
@@ -114,7 +114,7 @@ void FuzzerUtil::testConstantOptimizer(string const& _input, bool _quiet)
|
||||
ConstantOptimisationMethod::optimiseConstants(
|
||||
isCreation,
|
||||
runs,
|
||||
EVMVersion{},
|
||||
langutil::EVMVersion{},
|
||||
tmp
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user