diff options
Diffstat (limited to 'test/liblll/EndToEndTest.cpp')
-rw-r--r-- | test/liblll/EndToEndTest.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/liblll/EndToEndTest.cpp b/test/liblll/EndToEndTest.cpp index c8e7adf1..7f1924c2 100644 --- a/test/liblll/EndToEndTest.cpp +++ b/test/liblll/EndToEndTest.cpp @@ -291,6 +291,43 @@ BOOST_AUTO_TEST_CASE(zeroarg_macro) BOOST_CHECK(callFallback() == encodeArgs(u256(0x1234))); } +BOOST_AUTO_TEST_CASE(keccak256_32bytes) +{ + char const* sourceCode = R"( + (returnlll + (seq + (mstore 0x00 0x01) + (return (keccak256 0x00 0x20)))) + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callFallback() == encodeArgs( + fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6"))); +} + +BOOST_AUTO_TEST_CASE(sha3_two_args) +{ + char const* sourceCode = R"( + (returnlll + (seq + (mstore 0x00 0x01) + (return (sha3 0x00 0x20)))) + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callFallback() == encodeArgs( + fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6"))); +} + +BOOST_AUTO_TEST_CASE(sha3_one_arg) +{ + char const* sourceCode = R"( + (returnlll + (return (sha3 0x01))) + )"; + compileAndRun(sourceCode); + BOOST_CHECK(callFallback() == encodeArgs( + fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6"))); +} + BOOST_AUTO_TEST_SUITE_END() } |