mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2980 from ethereum/abi-api
Add abi.encode and abi.encodePacked
This commit is contained in:
@@ -7061,53 +7061,6 @@ BOOST_AUTO_TEST_CASE(reject_interface_constructors)
|
||||
CHECK_ERROR(text, TypeError, "Wrong argument count for constructor call: 1 arguments given but expected 0.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(tight_packing_literals)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f() pure public returns (bytes32) {
|
||||
return keccak256(1);
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() pure public returns (bytes32) {
|
||||
return keccak256(uint8(1));
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() pure public returns (bytes32) {
|
||||
return sha3(1);
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_WARNING_ALLOW_MULTI(text, (std::vector<std::string>{
|
||||
"The type of \"int_const 1\" was inferred as uint8.",
|
||||
"\"sha3\" has been deprecated in favour of \"keccak256\""
|
||||
}));
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() pure public returns (bytes32) {
|
||||
return sha256(1);
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
|
||||
text = R"(
|
||||
contract C {
|
||||
function f() pure public returns (bytes32) {
|
||||
return ripemd160(1);
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(non_external_fallback)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
||||
Reference in New Issue
Block a user