Fixed internal error related to ecrecover and ABIEncoderV2.

This commit is contained in:
chriseth
2019-02-19 14:17:03 +01:00
parent 8607690a30
commit 05541e5adb
3 changed files with 26 additions and 1 deletions
+19
View File
@@ -2633,6 +2633,25 @@ BOOST_AUTO_TEST_CASE(ecrecover)
ABI_CHECK(callContractFunction("a(bytes32,uint8,bytes32,bytes32)", h, v, r, s), encodeArgs(addr));
}
BOOST_AUTO_TEST_CASE(ecrecover_abiV2)
{
char const* sourceCode = R"(
pragma experimental ABIEncoderV2;
contract test {
function a(bytes32 h, uint8 v, bytes32 r, bytes32 s) public returns (address addr) {
return ecrecover(h, v, r, s);
}
}
)";
compileAndRun(sourceCode);
u256 h("0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c");
uint8_t v = 28;
u256 r("0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f");
u256 s("0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549");
u160 addr("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b");
ABI_CHECK(callContractFunction("a(bytes32,uint8,bytes32,bytes32)", h, v, r, s), encodeArgs(addr));
}
BOOST_AUTO_TEST_CASE(inter_contract_calls)
{
char const* sourceCode = R"(