Adjust tests.

This commit is contained in:
chriseth 2018-05-15 12:53:23 +02:00
parent 894122c508
commit 203475ef02
11 changed files with 28 additions and 10 deletions

View File

@ -5,6 +5,7 @@ contract C {
uint constant d = 2 + a;
}
// ----
// Warning: (98-110): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
// TypeError: (17-40): The value of the constant a has a cyclic dependency via c.
// TypeError: (71-111): The value of the constant c has a cyclic dependency via d.
// TypeError: (117-140): The value of the constant d has a cyclic dependency via a.

View File

@ -3,4 +3,6 @@ contract C {
uint constant b = 7;
uint constant c = 4 + uint(keccak256(d));
uint constant d = 2 + b;
}
}
// ----
// Warning: (98-110): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.

View File

@ -1,6 +1,6 @@
contract test {
function f() pure public {
bytes32 x = sha3(uint8(1));
bytes32 x = sha3();
x;
}
function g() public {
@ -8,5 +8,5 @@ contract test {
}
}
// ----
// Warning: (58-72): "sha3" has been deprecated in favour of "keccak256"
// Warning: (107-117): "suicide" has been deprecated in favour of "selfdestruct"
// Warning: (58-64): "sha3" has been deprecated in favour of "keccak256"
// Warning: (99-109): "suicide" has been deprecated in favour of "selfdestruct"

View File

@ -10,4 +10,5 @@ contract test {
}
// ----
// TypeError: (88-102): "sha3" has been deprecated in favour of "keccak256"
// TypeError: (88-102): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
// TypeError: (137-147): "suicide" has been deprecated in favour of "selfdestruct"

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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;
}
}

View File

@ -18,8 +18,12 @@ contract C {
// ----
// Warning: (87-88): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
// Warning: (77-89): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// Warning: (161-168): "sha3" has been deprecated in favour of "keccak256"
// Warning: (166-167): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
// Warning: (161-168): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// Warning: (247-248): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
// Warning: (240-249): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// Warning: (331-332): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
// Warning: (321-333): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// Warning: (420-421): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.

View File

@ -19,8 +19,12 @@ contract C {
// ----
// TypeError: (117-118): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
// TypeError: (107-119): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// TypeError: (191-198): "sha3" has been deprecated in favour of "keccak256"
// TypeError: (196-197): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
// TypeError: (191-198): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// TypeError: (277-278): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
// TypeError: (270-279): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// TypeError: (361-362): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.
// TypeError: (351-363): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type int_const 1 is not implicitly convertible to expected type bytes memory.
// TypeError: (450-451): Cannot perform packed encoding for a literal. Please convert it to an explicit type first.

View File

@ -19,4 +19,8 @@ contract C {
}
}
// ----
// Warning: (77-96): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
// Warning: (168-182): "sha3" has been deprecated in favour of "keccak256"
// Warning: (168-182): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
// Warning: (254-270): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.
// Warning: (342-361): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data. The provided argument of type uint8 is not implicitly convertible to expected type bytes memory.