From a53d6b499d5cc5c45fc096cea6393dc285581f90 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 22 Feb 2018 16:16:27 +0100 Subject: Use EVM version in type checker. --- test/libsolidity/Assembly.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test/libsolidity/Assembly.cpp') diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 59af6d41..57a4f4e0 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -20,11 +20,9 @@ * Unit tests for Assembly Items from evmasm/Assembly.h */ -#include -#include -#include #include #include + #include #include #include @@ -33,6 +31,11 @@ #include #include +#include + +#include +#include + using namespace std; using namespace dev::eth; @@ -46,7 +49,7 @@ namespace test namespace { -eth::AssemblyItems compileContract(const string& _sourceCode) +eth::AssemblyItems compileContract(string const& _sourceCode) { ErrorList errors; ErrorReporter errorReporter(errors); @@ -69,7 +72,7 @@ eth::AssemblyItems compileContract(const string& _sourceCode) for (ASTPointer const& node: sourceUnit->nodes()) if (ContractDefinition* contract = dynamic_cast(node.get())) { - TypeChecker checker(errorReporter); + TypeChecker checker(EVMVersion{}, errorReporter); BOOST_REQUIRE_NO_THROW(checker.checkTypeRequirements(*contract)); if (!Error::containsOnlyWarnings(errorReporter.errors())) return AssemblyItems(); -- cgit v1.2.3 From 05cc5f22b204a0c389e1de4feaa44d33492dd053 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 23 Feb 2018 19:29:20 +0100 Subject: Correctly set evm version in tests --- test/libsolidity/Assembly.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/libsolidity/Assembly.cpp') diff --git a/test/libsolidity/Assembly.cpp b/test/libsolidity/Assembly.cpp index 57a4f4e0..aff610a4 100644 --- a/test/libsolidity/Assembly.cpp +++ b/test/libsolidity/Assembly.cpp @@ -20,6 +20,8 @@ * Unit tests for Assembly Items from evmasm/Assembly.h */ +#include + #include #include @@ -72,7 +74,7 @@ eth::AssemblyItems compileContract(string const& _sourceCode) for (ASTPointer const& node: sourceUnit->nodes()) if (ContractDefinition* contract = dynamic_cast(node.get())) { - TypeChecker checker(EVMVersion{}, errorReporter); + TypeChecker checker(dev::test::Options::get().evmVersion(), errorReporter); BOOST_REQUIRE_NO_THROW(checker.checkTypeRequirements(*contract)); if (!Error::containsOnlyWarnings(errorReporter.errors())) return AssemblyItems(); @@ -80,7 +82,7 @@ eth::AssemblyItems compileContract(string const& _sourceCode) for (ASTPointer const& node: sourceUnit->nodes()) if (ContractDefinition* contract = dynamic_cast(node.get())) { - Compiler compiler; + Compiler compiler(dev::test::Options::get().evmVersion()); compiler.compileContract(*contract, map{}, bytes()); return compiler.runtimeAssemblyItems(); -- cgit v1.2.3