aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/solidityExecutionFramework.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-06-18 20:41:06 +0800
committerchriseth <c@ethdev.com>2015-06-18 20:41:46 +0800
commit6d2f2f668ba2529aa2ed0bae88afc55b2869cd97 (patch)
tree72908c0f5421b3db96a99e207d2da14afecd02f8 /libsolidity/solidityExecutionFramework.h
parent6c27ef73670185e5adf8f84c4bcfbf9ce860defd (diff)
downloaddexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar.gz
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar.bz2
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar.lz
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar.xz
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.tar.zst
dexon-solidity-6d2f2f668ba2529aa2ed0bae88afc55b2869cd97.zip
Tests for constructor arguments "from outside".
Diffstat (limited to 'libsolidity/solidityExecutionFramework.h')
-rw-r--r--libsolidity/solidityExecutionFramework.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/libsolidity/solidityExecutionFramework.h b/libsolidity/solidityExecutionFramework.h
index 4ba22981..0079d82b 100644
--- a/libsolidity/solidityExecutionFramework.h
+++ b/libsolidity/solidityExecutionFramework.h
@@ -42,19 +42,29 @@ class ExecutionFramework
public:
ExecutionFramework() { g_logVerbosity = 0; }
- bytes const& compileAndRunWthoutCheck(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
+ bytes const& compileAndRunWithoutCheck(
+ std::string const& _sourceCode,
+ u256 const& _value = 0,
+ std::string const& _contractName = "",
+ bytes const& _arguments = bytes()
+ )
{
m_compiler.reset(false, m_addStandardSources);
m_compiler.addSource("", _sourceCode);
ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), "Compiling contract failed");
bytes code = m_compiler.getBytecode(_contractName);
- sendMessage(code, true, _value);
+ sendMessage(code + _arguments, true, _value);
return m_output;
}
- bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "")
+ bytes const& compileAndRun(
+ std::string const& _sourceCode,
+ u256 const& _value = 0,
+ std::string const& _contractName = "",
+ bytes const& _arguments = bytes()
+ )
{
- compileAndRunWthoutCheck(_sourceCode, _value, _contractName);
+ compileAndRunWithoutCheck(_sourceCode, _value, _contractName, _arguments);
BOOST_REQUIRE(!m_output.empty());
return m_output;
}