Adjust tests.

This commit is contained in:
chriseth
2018-06-25 17:17:18 +02:00
committed by Alex Beregszaszi
parent 23c4142005
commit 86a720b96a
26 changed files with 103 additions and 173 deletions
@@ -7,9 +7,6 @@ contract C {
function g(bytes32) pure internal {}
}
// ----
// Warning: (54-72): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
// Warning: (54-72): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
// Warning: (85-100): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
// Warning: (85-100): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
// Warning: (113-131): This function only accepts a single "bytes" argument. Please use "abi.encodePacked(...)" or a similar function to encode the data.
// Warning: (113-131): The provided argument of type uint256 is not implicitly convertible to expected type bytes memory.
// TypeError: (64-71): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested.
// TypeError: (92-99): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested.
// TypeError: (123-130): Invalid type for argument in function call. Invalid implicit conversion from uint256 to bytes memory requested.
@@ -1,13 +1,13 @@
contract C {
function f() public pure {
bool a = address(this).call(address(this).delegatecall, super);
bool b = address(this).delegatecall(log0, tx, mulmod);
bool a = address(this).call(abi.encode(address(this).delegatecall, super));
bool b = address(this).delegatecall(abi.encode(log0, tx, mulmod));
a; b;
}
}
// ----
// TypeError: (80-106): This type cannot be encoded.
// TypeError: (108-113): This type cannot be encoded.
// TypeError: (160-164): This type cannot be encoded.
// TypeError: (166-168): This type cannot be encoded.
// TypeError: (170-176): This type cannot be encoded.
// TypeError: (91-117): This type cannot be encoded.
// TypeError: (119-124): This type cannot be encoded.
// TypeError: (183-187): This type cannot be encoded.
// TypeError: (189-191): This type cannot be encoded.
// TypeError: (193-199): This type cannot be encoded.
@@ -4,11 +4,10 @@ contract C {
struct T { uint y; }
T t;
function f() public view {
bytes32 a = sha256(s, t);
bytes32 a = sha256(abi.encodePacked(s, t));
a;
}
}
// ----
// 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.
// TypeError: (156-157): This type cannot be encoded.
// TypeError: (159-160): This type cannot be encoded.
@@ -6,12 +6,11 @@ contract C {
struct T { uint y; }
T t;
function f() public view {
bytes32 a = sha256(s, t);
bytes32 a = sha256(abi.encodePacked(s, t));
a;
}
}
// ----
// 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.
// TypeError: (191-192): This type cannot be encoded.
// TypeError: (194-195): This type cannot be encoded.
@@ -5,12 +5,13 @@ contract C {
T t;
enum A { X, Y }
function f() public pure {
bool a = address(this).delegatecall(S, A, A.X, T, uint, uint[]);
bytes memory a = abi.encodePacked(S, A, A.X, T, uint, uint[]);
a;
}
}
// ----
// TypeError: (176-177): This type cannot be encoded.
// TypeError: (179-180): This type cannot be encoded.
// TypeError: (187-188): This type cannot be encoded.
// TypeError: (190-194): This type cannot be encoded.
// TypeError: (196-202): This type cannot be encoded.
// TypeError: (174-175): This type cannot be encoded.
// TypeError: (177-178): This type cannot be encoded.
// TypeError: (185-186): This type cannot be encoded.
// TypeError: (188-192): This type cannot be encoded.
// TypeError: (194-200): This type cannot be encoded.