Add callFallback to ExectionFramework

This commit is contained in:
Alex Beregszaszi 2016-11-28 11:19:31 +00:00
parent 85ebe4e5c4
commit 94cae63390
2 changed files with 12 additions and 1 deletions

View File

@ -73,6 +73,17 @@ public:
return m_output;
}
bytes const& callFallbackWithValue(u256 const& _value)
{
sendMessage(bytes(), false, _value);
return m_output;
}
bytes const & callFallback()
{
return callFallbackWithValue(0);
}
template <class... Args>
bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments)
{

View File

@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
{
char const* sourceCode = "(returnlll { (return \"test\") })";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("") == encodeArgs(string("test", 4)));
BOOST_CHECK(callFallback() == encodeArgs(string("test", 4)));
}
BOOST_AUTO_TEST_SUITE_END()