aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/ViewPureChecker.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-08-16 06:13:21 +0800
committerGitHub <noreply@github.com>2018-08-16 06:13:21 +0800
commitcc6fa6d61fb934617d088bb04766ef0dea614b4f (patch)
tree3256618e2b268924442ea55e45622313969bad80 /test/libsolidity/ViewPureChecker.cpp
parentc164f80ba6b1c6753450b59365d1e0f1633688db (diff)
parentdb48925907ef4b31025f83ca83298483c4860583 (diff)
downloaddexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.gz
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.bz2
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.lz
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.xz
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.tar.zst
dexon-solidity-cc6fa6d61fb934617d088bb04766ef0dea614b4f.zip
Merge pull request #4822 from ethereum/addressStaticCall
Add ``staticcall`` to ``address``.
Diffstat (limited to 'test/libsolidity/ViewPureChecker.cpp')
-rw-r--r--test/libsolidity/ViewPureChecker.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp
index 299cd084..d993b92e 100644
--- a/test/libsolidity/ViewPureChecker.cpp
+++ b/test/libsolidity/ViewPureChecker.cpp
@@ -53,8 +53,11 @@ BOOST_AUTO_TEST_CASE(environment_access)
"tx.origin",
"tx.gasprice",
"this",
- "address(1).balance"
+ "address(1).balance",
};
+ if (dev::test::Options::get().evmVersion().hasStaticCall())
+ view.emplace_back("address(0x4242).staticcall(\"\")");
+
// ``block.blockhash`` and ``blockhash`` are tested separately below because their usage will
// produce warnings that can't be handled in a generic way.
vector<string> pure{
@@ -95,6 +98,22 @@ BOOST_AUTO_TEST_CASE(environment_access)
);
}
+BOOST_AUTO_TEST_CASE(address_staticcall)
+{
+ string text = R"(
+ contract C {
+ function i() view public returns (bool) {
+ return address(0x4242).staticcall("");
+ }
+ }
+ )";
+ if (!dev::test::Options::get().evmVersion().hasStaticCall())
+ CHECK_ERROR(text, TypeError, "\"staticcall\" is not supported by the VM version.");
+ else
+ CHECK_SUCCESS_NO_WARNINGS(text);
+}
+
+
BOOST_AUTO_TEST_CASE(assembly_staticcall)
{
string text = R"(