aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-04 22:31:25 +0800
committerGitHub <noreply@github.com>2018-09-04 22:31:25 +0800
commitcc7daf7b476f498c4dcde7bdb342974097ffe9bf (patch)
tree707656e46a626f93bb24d45710ebda7ab31a013f /test/libsolidity/syntaxTests/viewPureChecker
parentd88e5039ccc768f810f7882aa1f9ae338bc27dd3 (diff)
parente3097b30dace9bbd88a5a74e6507baad0bc12cc4 (diff)
downloaddexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar.gz
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar.bz2
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar.lz
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar.xz
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.tar.zst
dexon-solidity-cc7daf7b476f498c4dcde7bdb342974097ffe9bf.zip
Merge pull request #4829 from ethereum/callBytesReturn
Add return data to bare calls.
Diffstat (limited to 'test/libsolidity/syntaxTests/viewPureChecker')
-rw-r--r--test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol6
-rw-r--r--test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol10
2 files changed, 10 insertions, 6 deletions
diff --git a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
index 2cb185c9..2503a319 100644
--- a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
+++ b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions.sol
@@ -3,8 +3,10 @@ contract C {
address(this).transfer(1);
require(address(this).send(2));
selfdestruct(address(this));
- require(address(this).delegatecall(""));
- require(address(this).call(""));
+ (bool success,) = address(this).delegatecall("");
+ require(success);
+ (success,) = address(this).call("");
+ require(success);
}
function g() pure public {
bytes32 x = keccak256("abc");
diff --git a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol
index 9b00fd6d..f951feb4 100644
--- a/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol
+++ b/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol
@@ -9,15 +9,17 @@ contract C {
selfdestruct(address(this));
}
function i() view public {
- require(address(this).delegatecall(""));
+ (bool success,) = address(this).delegatecall("");
+ require(success);
}
function j() view public {
- require(address(this).call(""));
+ (bool success,) = address(this).call("");
+ require(success);
}
}
// ----
// TypeError: (52-77): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (132-153): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (201-228): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
-// TypeError: (283-313): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
-// TypeError: (369-391): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
+// TypeError: (293-323): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
+// TypeError: (414-436): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.