aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 23bd2abc..9485c5fa 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -2872,6 +2872,24 @@ BOOST_AUTO_TEST_CASE(iterated_sha3_with_bytes)
));
}
+BOOST_AUTO_TEST_CASE(keccak256_multiple_arguments)
+{
+ char const* sourceCode = R"(
+ contract c {
+ function foo(uint a, uint b, uint c) returns (bytes32 d)
+ {
+ d = keccak256(a, b, c);
+ }
+ })";
+ compileAndRun(sourceCode);
+
+ BOOST_CHECK(callContractFunction("foo(uint256,uint256,uint256)", 10, 12, 13) == encodeArgs(
+ dev::sha3(
+ toBigEndian(u256(10)) +
+ toBigEndian(u256(12)) +
+ toBigEndian(u256(13)))));
+}
+
BOOST_AUTO_TEST_CASE(generic_call)
{
char const* sourceCode = R"**(