diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index bb5a54b8c..f3098f282 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -107,7 +107,7 @@ public: bool runDeduplicate = false; bool runCSE = false; bool runConstantOptimiser = false; - solidity::EVMVersion evmVersion; + langutil::EVMVersion evmVersion; /// This specifies an estimate on how often each opcode in this assembly will be executed, /// i.e. use a small value to optimise for size and a large value to optimise for runtime gas usage. size_t expectedExecutionsPerDeployment = 200; @@ -121,7 +121,7 @@ public: /// @a _runs specifes an estimate on how often each opcode in this assembly will be executed, /// i.e. use a small value to optimise for size and a large value to optimise for runtime. /// If @a _enable is not set, will perform some simple peephole optimizations. - Assembly& optimise(bool _enable, EVMVersion _evmVersion, bool _isCreation = true, size_t _runs = 200); + Assembly& optimise(bool _enable, langutil::EVMVersion _evmVersion, bool _isCreation = true, size_t _runs = 200); /// Create a text representation of the assembly. std::string assemblyString( diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index ae3039a6c..267daa5e5 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -29,7 +29,7 @@ using namespace dev::eth; unsigned ConstantOptimisationMethod::optimiseConstants( bool _isCreation, size_t _runs, - solidity::EVMVersion _evmVersion, + langutil::EVMVersion _evmVersion, Assembly& _assembly ) { diff --git a/libevmasm/ConstantOptimiser.h b/libevmasm/ConstantOptimiser.h index 92436db15..be1628c71 100644 --- a/libevmasm/ConstantOptimiser.h +++ b/libevmasm/ConstantOptimiser.h @@ -52,7 +52,7 @@ public: static unsigned optimiseConstants( bool _isCreation, size_t _runs, - solidity::EVMVersion _evmVersion, + langutil::EVMVersion _evmVersion, Assembly& _assembly ); @@ -64,7 +64,7 @@ protected: bool isCreation; ///< Whether this is called during contract creation or runtime. size_t runs; ///< Estimated number of calls per opcode oven the lifetime of the contract. size_t multiplicity; ///< Number of times the constant appears in the code. - solidity::EVMVersion evmVersion; ///< Version of the EVM + langutil::EVMVersion evmVersion; ///< Version of the EVM }; explicit ConstantOptimisationMethod(Params const& _params, u256 const& _value): diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index e3909e86c..f988138c0 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -47,24 +47,24 @@ namespace GasCosts static unsigned const tier5Gas = 10; static unsigned const tier6Gas = 20; static unsigned const tier7Gas = 0; - inline unsigned extCodeGas(EVMVersion _evmVersion) + inline unsigned extCodeGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::tangerineWhistle() ? 700 : 20; + return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 700 : 20; } - inline unsigned balanceGas(EVMVersion _evmVersion) + inline unsigned balanceGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::tangerineWhistle() ? 400 : 20; + return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 400 : 20; } static unsigned const expGas = 10; - inline unsigned expByteGas(EVMVersion _evmVersion) + inline unsigned expByteGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::spuriousDragon() ? 50 : 10; + return _evmVersion >= langutil::EVMVersion::spuriousDragon() ? 50 : 10; } static unsigned const keccak256Gas = 30; static unsigned const keccak256WordGas = 6; - inline unsigned sloadGas(EVMVersion _evmVersion) + inline unsigned sloadGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::tangerineWhistle() ? 200 : 50; + return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 200 : 50; } static unsigned const sstoreSetGas = 20000; static unsigned const sstoreResetGas = 5000; @@ -74,16 +74,16 @@ namespace GasCosts static unsigned const logDataGas = 8; static unsigned const logTopicGas = 375; static unsigned const createGas = 32000; - inline unsigned callGas(EVMVersion _evmVersion) + inline unsigned callGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::tangerineWhistle() ? 700 : 40; + return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 700 : 40; } static unsigned const callStipend = 2300; static unsigned const callValueTransferGas = 9000; static unsigned const callNewAccountGas = 25000; - inline unsigned selfdestructGas(EVMVersion _evmVersion) + inline unsigned selfdestructGas(langutil::EVMVersion _evmVersion) { - return _evmVersion >= EVMVersion::tangerineWhistle() ? 5000 : 0; + return _evmVersion >= langutil::EVMVersion::tangerineWhistle() ? 5000 : 0; } static unsigned const selfdestructRefundGas = 24000; static unsigned const memoryGas = 3; @@ -122,7 +122,7 @@ public: }; /// Constructs a new gas meter given the current state. - GasMeter(std::shared_ptr const& _state, solidity::EVMVersion _evmVersion, u256 const& _largestMemoryAccess = 0): + GasMeter(std::shared_ptr const& _state, langutil::EVMVersion _evmVersion, u256 const& _largestMemoryAccess = 0): m_state(_state), m_evmVersion(_evmVersion), m_largestMemoryAccess(_largestMemoryAccess) {} /// @returns an upper bound on the gas consumed by the given instruction and updates @@ -152,7 +152,7 @@ private: GasConsumption memoryGas(int _stackPosOffset, int _stackPosSize); std::shared_ptr m_state; - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; /// Largest point where memory was accessed since the creation of this object. u256 m_largestMemoryAccess; }; diff --git a/libevmasm/PathGasMeter.cpp b/libevmasm/PathGasMeter.cpp index cdadba768..0b199806c 100644 --- a/libevmasm/PathGasMeter.cpp +++ b/libevmasm/PathGasMeter.cpp @@ -27,7 +27,7 @@ using namespace std; using namespace dev; using namespace dev::eth; -PathGasMeter::PathGasMeter(AssemblyItems const& _items, solidity::EVMVersion _evmVersion): +PathGasMeter::PathGasMeter(AssemblyItems const& _items, langutil::EVMVersion _evmVersion): m_items(_items), m_evmVersion(_evmVersion) { for (size_t i = 0; i < m_items.size(); ++i) diff --git a/libevmasm/PathGasMeter.h b/libevmasm/PathGasMeter.h index 772df4844..67b607c42 100644 --- a/libevmasm/PathGasMeter.h +++ b/libevmasm/PathGasMeter.h @@ -53,13 +53,13 @@ struct GasPath class PathGasMeter { public: - explicit PathGasMeter(AssemblyItems const& _items, solidity::EVMVersion _evmVersion); + explicit PathGasMeter(AssemblyItems const& _items, langutil::EVMVersion _evmVersion); GasMeter::GasConsumption estimateMax(size_t _startIndex, std::shared_ptr const& _state); static GasMeter::GasConsumption estimateMax( AssemblyItems const& _items, - solidity::EVMVersion _evmVersion, + langutil::EVMVersion _evmVersion, size_t _startIndex, std::shared_ptr const& _state ) @@ -81,7 +81,7 @@ private: std::map m_highestGasUsagePerJumpdest; std::map m_tagPositions; AssemblyItems const& m_items; - solidity::EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; }; } diff --git a/liblangutil/EVMVersion.h b/liblangutil/EVMVersion.h index 21889bd9c..3d76cbff6 100644 --- a/liblangutil/EVMVersion.h +++ b/liblangutil/EVMVersion.h @@ -25,9 +25,7 @@ #include #include -namespace dev -{ -namespace solidity +namespace langutil { /** @@ -91,4 +89,3 @@ private: } -} diff --git a/libsolidity/analysis/TypeChecker.h b/libsolidity/analysis/TypeChecker.h index d5f3645c5..09879322e 100644 --- a/libsolidity/analysis/TypeChecker.h +++ b/libsolidity/analysis/TypeChecker.h @@ -48,7 +48,7 @@ class TypeChecker: private ASTConstVisitor { public: /// @param _errorReporter provides the error logging functionality. - TypeChecker(EVMVersion _evmVersion, langutil::ErrorReporter& _errorReporter): + TypeChecker(langutil::EVMVersion _evmVersion, langutil::ErrorReporter& _errorReporter): m_evmVersion(_evmVersion), m_errorReporter(_errorReporter) {} @@ -156,7 +156,7 @@ private: ContractDefinition const* m_scope = nullptr; - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; /// Flag indicating whether we are currently inside an EmitStatement. bool m_insideEmitStatement = false; diff --git a/libsolidity/codegen/ABIFunctions.h b/libsolidity/codegen/ABIFunctions.h index 8d8be9d71..654afc034 100644 --- a/libsolidity/codegen/ABIFunctions.h +++ b/libsolidity/codegen/ABIFunctions.h @@ -50,7 +50,7 @@ using TypePointers = std::vector; class ABIFunctions { public: - explicit ABIFunctions(EVMVersion _evmVersion = EVMVersion{}) : m_evmVersion(_evmVersion) {} + explicit ABIFunctions(langutil::EVMVersion _evmVersion = langutil::EVMVersion{}) : m_evmVersion(_evmVersion) {} /// @returns name of an assembly function to ABI-encode values of @a _givenTypes /// into memory, converting the types to @a _targetTypes on the fly. @@ -286,7 +286,7 @@ private: /// Map from function name to code for a multi-use function. std::map m_requestedFunctions; std::set m_externallyUsedFunctions; - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; }; } diff --git a/libsolidity/codegen/Compiler.h b/libsolidity/codegen/Compiler.h index c21de96d8..53f3108a2 100644 --- a/libsolidity/codegen/Compiler.h +++ b/libsolidity/codegen/Compiler.h @@ -34,7 +34,7 @@ namespace solidity { class Compiler { public: - explicit Compiler(EVMVersion _evmVersion = EVMVersion{}, bool _optimize = false, unsigned _runs = 200): + explicit Compiler(langutil::EVMVersion _evmVersion = langutil::EVMVersion{}, bool _optimize = false, unsigned _runs = 200): m_optimize(_optimize), m_optimizeRuns(_runs), m_runtimeContext(_evmVersion), diff --git a/libsolidity/codegen/CompilerContext.h b/libsolidity/codegen/CompilerContext.h index 779fbf460..e730b46e0 100644 --- a/libsolidity/codegen/CompilerContext.h +++ b/libsolidity/codegen/CompilerContext.h @@ -50,7 +50,7 @@ class Compiler; class CompilerContext { public: - explicit CompilerContext(EVMVersion _evmVersion = EVMVersion{}, CompilerContext* _runtimeContext = nullptr): + explicit CompilerContext(langutil::EVMVersion _evmVersion = langutil::EVMVersion{}, CompilerContext* _runtimeContext = nullptr): m_asm(std::make_shared()), m_evmVersion(_evmVersion), m_runtimeContext(_runtimeContext), @@ -60,7 +60,7 @@ public: m_runtimeSub = size_t(m_asm->newSub(m_runtimeContext->m_asm).data()); } - EVMVersion const& evmVersion() const { return m_evmVersion; } + langutil::EVMVersion const& evmVersion() const { return m_evmVersion; } /// Update currently enabled set of experimental features. void setExperimentalFeatures(std::set const& _features) { m_experimentalFeatures = _features; } @@ -305,7 +305,7 @@ private: eth::AssemblyPointer m_asm; /// Version of the EVM to compile against. - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; /// Activated experimental features. std::set m_experimentalFeatures; /// Other already compiled contracts to be used in contract creation calls. diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index b97e064e8..e9f694c11 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -91,7 +91,7 @@ void CompilerStack::setRemappings(vector const& _remappings) m_remappings = _remappings; } -void CompilerStack::setEVMVersion(EVMVersion _version) +void CompilerStack::setEVMVersion(langutil::EVMVersion _version) { solAssert(m_stackState < State::ParsingSuccessful, "Set EVM version after parsing."); m_evmVersion = _version; @@ -113,7 +113,7 @@ void CompilerStack::reset(bool _keepSources) m_smtlib2Responses.clear(); m_unhandledSMTLib2Queries.clear(); m_libraries.clear(); - m_evmVersion = EVMVersion(); + m_evmVersion = langutil::EVMVersion(); m_optimize = false; m_optimizeRuns = 200; m_globalContext.reset(); diff --git a/libsolidity/interface/CompilerStack.h b/libsolidity/interface/CompilerStack.h index 799278503..12a0a5e0c 100644 --- a/libsolidity/interface/CompilerStack.h +++ b/libsolidity/interface/CompilerStack.h @@ -136,7 +136,7 @@ public: /// Set the EVM version used before running compile. /// When called without an argument it will revert to the default version. - void setEVMVersion(EVMVersion _version = EVMVersion{}); + void setEVMVersion(langutil::EVMVersion _version = langutil::EVMVersion{}); /// Sets the list of requested contract names. If empty, no filtering is performed and every contract /// found in the supplied sources is compiled. Names are cleared iff @a _contractNames is missing. @@ -348,7 +348,7 @@ private: ReadCallback::Callback m_readFile; bool m_optimize = false; unsigned m_optimizeRuns = 200; - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; std::set m_requestedContractNames; std::map m_libraries; /// list of path prefix remappings, e.g. mylibrary: github.com/ethereum = /usr/local/ethereum diff --git a/libsolidity/interface/GasEstimator.h b/libsolidity/interface/GasEstimator.h index f40cffebd..784fada2f 100644 --- a/libsolidity/interface/GasEstimator.h +++ b/libsolidity/interface/GasEstimator.h @@ -47,7 +47,7 @@ public: using ASTGasConsumptionSelfAccumulated = std::map>; - explicit GasEstimator(EVMVersion _evmVersion): m_evmVersion(_evmVersion) {} + explicit GasEstimator(langutil::EVMVersion _evmVersion): m_evmVersion(_evmVersion) {} /// Estimates the gas consumption for every assembly item in the given assembly and stores /// it by source location. @@ -84,7 +84,7 @@ public: private: /// @returns the set of AST nodes which are the finest nodes at their location. static std::set finestNodesAtLocation(std::vector const& _roots); - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; }; } diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 606e858c6..4456a504b 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -490,7 +490,7 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) { if (!settings["evmVersion"].isString()) return formatFatalError("JSONError", "evmVersion must be a string."); - boost::optional version = EVMVersion::fromString(settings["evmVersion"].asString()); + boost::optional version = langutil::EVMVersion::fromString(settings["evmVersion"].asString()); if (!version) return formatFatalError("JSONError", "Invalid EVM version requested."); m_compilerStack.setEVMVersion(*version); diff --git a/libyul/AsmAnalysis.h b/libyul/AsmAnalysis.h index 463c34c59..7d11391f9 100644 --- a/libyul/AsmAnalysis.h +++ b/libyul/AsmAnalysis.h @@ -121,7 +121,7 @@ private: std::set m_activeVariables; AsmAnalysisInfo& m_info; langutil::ErrorReporter& m_errorReporter; - dev::solidity::EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; std::shared_ptr m_dialect; boost::optional m_errorTypeForLoose; }; diff --git a/libyul/AssemblyStack.h b/libyul/AssemblyStack.h index 563ecb431..4484c546c 100644 --- a/libyul/AssemblyStack.h +++ b/libyul/AssemblyStack.h @@ -58,7 +58,7 @@ public: enum class Language { Yul, Assembly, StrictAssembly }; enum class Machine { EVM, EVM15, eWasm }; - explicit AssemblyStack(dev::solidity::EVMVersion _evmVersion = dev::solidity::EVMVersion(), Language _language = Language::Assembly): + explicit AssemblyStack(langutil::EVMVersion _evmVersion = langutil::EVMVersion(), Language _language = Language::Assembly): m_language(_language), m_evmVersion(_evmVersion), m_errorReporter(m_errors) {} @@ -94,7 +94,7 @@ private: void optimize(yul::Object& _object); Language m_language = Language::Assembly; - dev::solidity::EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; std::shared_ptr m_scanner; diff --git a/libyul/backends/evm/AsmCodeGen.cpp b/libyul/backends/evm/AsmCodeGen.cpp index 905f09752..19c87b77d 100644 --- a/libyul/backends/evm/AsmCodeGen.cpp +++ b/libyul/backends/evm/AsmCodeGen.cpp @@ -177,7 +177,7 @@ void CodeGenerator::assemble( Block const& _parsedData, AsmAnalysisInfo& _analysisInfo, eth::Assembly& _assembly, - dev::solidity::EVMVersion _evmVersion, + langutil::EVMVersion _evmVersion, ExternalIdentifierAccess const& _identifierAccess, bool _useNamedLabelsForFunctions, bool _optimize diff --git a/libyul/backends/evm/AsmCodeGen.h b/libyul/backends/evm/AsmCodeGen.h index 0b86e6e9d..2c09e2556 100644 --- a/libyul/backends/evm/AsmCodeGen.h +++ b/libyul/backends/evm/AsmCodeGen.h @@ -79,7 +79,7 @@ public: Block const& _parsedData, AsmAnalysisInfo& _analysisInfo, dev::eth::Assembly& _assembly, - dev::solidity::EVMVersion _evmVersion, + langutil::EVMVersion _evmVersion, ExternalIdentifierAccess const& _identifierAccess = ExternalIdentifierAccess(), bool _useNamedLabelsForFunctions = false, bool _optimize = false diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index 9aec768a6..b779fd301 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -37,7 +37,7 @@ using namespace yul; using namespace dev::solidity; -EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess, EVMVersion _evmVersion): +EVMDialect::EVMDialect(AsmFlavour _flavour, bool _objectAccess, langutil::EVMVersion _evmVersion): Dialect{_flavour}, m_objectAccess(_objectAccess), m_evmVersion(_evmVersion) { // The EVM instructions will be moved to builtins at some point. @@ -91,22 +91,22 @@ BuiltinFunctionForEVM const* EVMDialect::builtin(YulString _name) const return nullptr; } -shared_ptr EVMDialect::looseAssemblyForEVM(EVMVersion _version) +shared_ptr EVMDialect::looseAssemblyForEVM(langutil::EVMVersion _version) { return make_shared(AsmFlavour::Loose, false, _version); } -shared_ptr EVMDialect::strictAssemblyForEVM(EVMVersion _version) +shared_ptr EVMDialect::strictAssemblyForEVM(langutil::EVMVersion _version) { return make_shared(AsmFlavour::Strict, false, _version); } -shared_ptr EVMDialect::strictAssemblyForEVMObjects(EVMVersion _version) +shared_ptr EVMDialect::strictAssemblyForEVMObjects(langutil::EVMVersion _version) { return make_shared(AsmFlavour::Strict, true, _version); } -shared_ptr EVMDialect::yulForEVM(EVMVersion _version) +shared_ptr EVMDialect::yulForEVM(langutil::EVMVersion _version) { return make_shared(AsmFlavour::Yul, false, _version); } diff --git a/libyul/backends/evm/EVMDialect.h b/libyul/backends/evm/EVMDialect.h index 61b0a0ae9..c8284a7ec 100644 --- a/libyul/backends/evm/EVMDialect.h +++ b/libyul/backends/evm/EVMDialect.h @@ -50,17 +50,17 @@ struct BuiltinFunctionForEVM: BuiltinFunction */ struct EVMDialect: public Dialect { - EVMDialect(AsmFlavour _flavour, bool _objectAccess, dev::solidity::EVMVersion _evmVersion); + EVMDialect(AsmFlavour _flavour, bool _objectAccess, langutil::EVMVersion _evmVersion); /// @returns the builtin function of the given name or a nullptr if it is not a builtin function. BuiltinFunctionForEVM const* builtin(YulString _name) const override; - static std::shared_ptr looseAssemblyForEVM(dev::solidity::EVMVersion _version); - static std::shared_ptr strictAssemblyForEVM(dev::solidity::EVMVersion _version); - static std::shared_ptr strictAssemblyForEVMObjects(dev::solidity::EVMVersion _version); - static std::shared_ptr yulForEVM(dev::solidity::EVMVersion _version); + static std::shared_ptr looseAssemblyForEVM(langutil::EVMVersion _version); + static std::shared_ptr strictAssemblyForEVM(langutil::EVMVersion _version); + static std::shared_ptr strictAssemblyForEVMObjects(langutil::EVMVersion _version); + static std::shared_ptr yulForEVM(langutil::EVMVersion _version); - dev::solidity::EVMVersion evmVersion() const { return m_evmVersion; } + langutil::EVMVersion evmVersion() const { return m_evmVersion; } bool providesObjectAccess() const { return m_objectAccess; } @@ -80,7 +80,7 @@ protected: ); bool m_objectAccess; - dev::solidity::EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; Object const* m_currentObject = nullptr; /// Mapping from named objects to abstract assembly sub IDs. std::map m_subIDs; diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index fc0dd3af2..dd3f4a125 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -830,7 +830,7 @@ bool CommandLineInterface::processInput() if (m_args.count(g_strEVMVersion)) { string versionOptionStr = m_args[g_strEVMVersion].as(); - boost::optional versionOption = EVMVersion::fromString(versionOptionStr); + boost::optional versionOption = langutil::EVMVersion::fromString(versionOptionStr); if (!versionOption) { serr() << "Invalid option for --evm-version: " << versionOptionStr << endl; diff --git a/solc/CommandLineInterface.h b/solc/CommandLineInterface.h index cc425134b..0d3c656f5 100644 --- a/solc/CommandLineInterface.h +++ b/solc/CommandLineInterface.h @@ -108,7 +108,7 @@ private: /// Solidity compiler stack std::unique_ptr m_compiler; /// EVM version to use - EVMVersion m_evmVersion; + langutil::EVMVersion m_evmVersion; /// Whether or not to colorize diagnostics output. bool m_coloredOutput = true; }; diff --git a/test/ExecutionFramework.h b/test/ExecutionFramework.h index 782c1d941..820ec55ae 100644 --- a/test/ExecutionFramework.h +++ b/test/ExecutionFramework.h @@ -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; diff --git a/test/Options.cpp b/test/Options.cpp index 62269dcaa..e7d4badb1 100644 --- a/test/Options.cpp +++ b/test/Options.cpp @@ -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(); } diff --git a/test/Options.h b/test/Options.h index 6e1395da8..7f2ea430b 100644 --- a/test/Options.h +++ b/test/Options.h @@ -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(); diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 3f71054a3..600925946 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -237,16 +237,16 @@ string RPCSession::personal_newAccount(string const& _password) void RPCSession::test_setChainParams(vector 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"( { diff --git a/test/libsolidity/ABIDecoderTests.cpp b/test/libsolidity/ABIDecoderTests.cpp index ce6afcf35..4cb41c87b 100644 --- a/test/libsolidity/ABIDecoderTests.cpp +++ b/test/libsolidity/ABIDecoderTests.cpp @@ -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)); diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index ee3cc626b..cb91448f4 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -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 { diff --git a/test/tools/fuzzer_common.cpp b/test/tools/fuzzer_common.cpp index ae52c5c22..0c031c9da 100644 --- a/test/tools/fuzzer_common.cpp +++ b/test/tools/fuzzer_common.cpp @@ -114,7 +114,7 @@ void FuzzerUtil::testConstantOptimizer(string const& _input, bool _quiet) ConstantOptimisationMethod::optimiseConstants( isCreation, runs, - EVMVersion{}, + langutil::EVMVersion{}, tmp ); }