Add abi.encode, abi.encodePacked, abi.encodeWithSelector and abi.encodeWithSignature.

This commit is contained in:
Alex Beregszaszi
2018-04-11 22:32:10 +02:00
committed by chriseth
parent ee5d0ef79b
commit d56acb68ab
7 changed files with 287 additions and 4 deletions
@@ -7120,6 +7120,22 @@ BOOST_AUTO_TEST_CASE(tight_packing_literals)
}
)";
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
text = R"(
contract C {
function f() pure public returns (bytes) {
return abi.encode(1);
}
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
text = R"(
contract C {
function f() pure public returns (bytes) {
return abi.encodePacked(1);
}
}
)";
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
}
BOOST_AUTO_TEST_CASE(non_external_fallback)