Decoder tests.

This commit is contained in:
chriseth
2017-11-29 17:08:44 +01:00
parent bdc1ff8ec7
commit 98c38108e8
5 changed files with 866 additions and 34 deletions
+13 -3
View File
@@ -84,12 +84,22 @@ public:
return callFallbackWithValue(0);
}
bytes const& callContractFunctionWithValueNoEncoding(std::string _sig, u256 const& _value, bytes const& _arguments)
{
FixedHash<4> hash(dev::keccak256(_sig));
sendMessage(hash.asBytes() + _arguments, false, _value);
return m_output;
}
bytes const& callContractFunctionNoEncoding(std::string _sig, bytes const& _arguments)
{
return callContractFunctionWithValueNoEncoding(_sig, 0, _arguments);
}
template <class... Args>
bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments)
{
FixedHash<4> hash(dev::keccak256(_sig));
sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value);
return m_output;
return callContractFunctionWithValueNoEncoding(_sig, _value, encodeArgs(_arguments...));
}
template <class... Args>