LLL: Test case for ecrecover built-in macro.

This commit is contained in:
benjaminion 2017-06-17 21:05:28 +01:00
parent 6cab6b6f49
commit 35bf91407e

View File

@ -328,6 +328,25 @@ BOOST_AUTO_TEST_CASE(sha3_one_arg)
fromHex("b10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6")));
}
BOOST_AUTO_TEST_CASE(ecrecover)
{
char const* sourceCode = R"(
(returnlll
(return
(ecrecover
; Hash of 'hello world'
0x47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad
; v = 1 + 27
0x1c
; r
0xdebaaa0cddb321b2dcaaf846d39605de7b97e77ba6106587855b9106cb104215
; s
0x61a22d94fa8b8a687ff9c911c844d1c016d1a685a9166858f9c7c1bc85128aca)))
)";
compileAndRun(sourceCode);
BOOST_CHECK(callFallback() == encodeArgs(fromHex("0x8743523d96a1b2cbe0c6909653a56da18ed484af")));
}
BOOST_AUTO_TEST_CASE(shift_left)
{
char const* sourceCode = R"(