aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-02-28 02:28:48 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-02-28 03:08:24 +0800
commit029e19983cdc444749258d21b448e52c48d2088d (patch)
tree71b20ee8fdba141329188d56ecae559d391fa0cb /test/libsolidity
parent908b46e9a7f56a06c76db9e702fb9b25d8b0d344 (diff)
downloaddexon-solidity-029e19983cdc444749258d21b448e52c48d2088d.tar.gz
dexon-solidity-029e19983cdc444749258d21b448e52c48d2088d.tar.zst
dexon-solidity-029e19983cdc444749258d21b448e52c48d2088d.zip
Split compileContract off compileAndRunWithoutCheck in SolidityExecutionFramework
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityExecutionFramework.h14
1 files 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
@@ -52,6 +52,17 @@ public:
std::map<std::string, dev::test::Address> const& _libraryAddresses = std::map<std::string, dev::test::Address>()
) 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<std::string, dev::test::Address> const& _libraryAddresses = std::map<std::string, dev::test::Address>()
+ )
+ {
// Silence compiler version warning
std::string sourceCode = "pragma solidity >=0.0;\n" + _sourceCode;
m_compiler.reset(false);
@@ -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: