diff options
author | chriseth <chris@ethereum.org> | 2018-05-15 18:53:23 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-05-16 15:48:03 +0800 |
commit | 203475ef020d8bf0c0334e51580dc798185b2359 (patch) | |
tree | 046c024b983ff642003157a25dccba84b503845c /test/libsolidity/syntaxTests/specialFunctions | |
parent | 894122c508c4de07553c7e2908ae36821e812a9f (diff) | |
download | dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar.gz dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar.bz2 dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar.lz dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar.xz dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.tar.zst dexon-solidity-203475ef020d8bf0c0334e51580dc798185b2359.zip |
Adjust tests.
Diffstat (limited to 'test/libsolidity/syntaxTests/specialFunctions')
4 files changed, 8 insertions, 6 deletions
diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol index c98d7a57..b94a4391 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_internal_functions.sol @@ -1,11 +1,11 @@ contract C { function f() public pure { - bytes32 h = keccak256(keccak256, f, this.f.gas, block.blockhash); + bytes32 h = keccak256(abi.encodePacked(keccak256, f, this.f.gas, block.blockhash)); h; } } // ---- -// TypeError: (74-83): This type cannot be encoded. -// TypeError: (85-86): This type cannot be encoded. -// TypeError: (88-98): This type cannot be encoded. -// TypeError: (100-115): This type cannot be encoded. +// TypeError: (91-100): This type cannot be encoded. +// TypeError: (102-103): This type cannot be encoded. +// TypeError: (105-115): This type cannot be encoded. +// TypeError: (117-132): This type cannot be encoded. diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol index fa910260..05f5db0b 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs.sol @@ -9,5 +9,6 @@ contract C { } } // ---- +// Warning: (132-144): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. // TypeError: (139-140): This type cannot be encoded. // TypeError: (142-143): This type cannot be encoded. diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol index 1187ce4a..977a7d73 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/types_with_unspecified_encoding_structs_abiv2.sol @@ -12,5 +12,6 @@ contract C { } // ---- // Warning: (0-33): Experimental features are turned on. Do not use experimental features on live deployments. +// Warning: (167-179): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. // TypeError: (174-175): This type cannot be encoded. // TypeError: (177-178): This type cannot be encoded. diff --git a/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol b/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol index c8364548..d890e35f 100644 --- a/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol +++ b/test/libsolidity/syntaxTests/specialFunctions/types_without_encoding_problems.sol @@ -2,7 +2,7 @@ contract C { uint[3] sarr; function f() view public { uint[3] memory arr; - bytes32 h = keccak256(this.f, arr, sarr); + bytes32 h = keccak256(abi.encodePacked(this.f, arr, sarr)); h; } } |