From 029e19983cdc444749258d21b448e52c48d2088d Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Tue, 27 Feb 2018 19:28:48 +0100 Subject: Split compileContract off compileAndRunWithoutCheck in SolidityExecutionFramework --- test/libsolidity/SolidityExecutionFramework.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SolidityExecutionFramework.h b/test/libsolidity/SolidityExecutionFramework.h index b853d558..f562721d 100644 --- a/test/libsolidity/SolidityExecutionFramework.h +++ b/test/libsolidity/SolidityExecutionFramework.h @@ -51,6 +51,17 @@ public: bytes const& _arguments = bytes(), std::map const& _libraryAddresses = std::map() ) override + { + bytes bytecode = compileContract(_sourceCode, _contractName, _libraryAddresses); + sendMessage(bytecode + _arguments, true, _value); + return m_output; + } + + bytes compileContract( + std::string const& _sourceCode, + std::string const& _contractName = "", + std::map const& _libraryAddresses = std::map() + ) { // Silence compiler version warning std::string sourceCode = "pragma solidity >=0.0;\n" + _sourceCode; @@ -72,8 +83,7 @@ public: } eth::LinkerObject obj = m_compiler.object(_contractName.empty() ? m_compiler.lastContractName() : _contractName); BOOST_REQUIRE(obj.linkReferences.empty()); - sendMessage(obj.bytecode + _arguments, true, _value); - return m_output; + return obj.bytecode; } protected: -- cgit v1.2.3