diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-07-04 17:42:05 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-07-04 17:42:05 +0800 |
commit | 8202d512e0bd4e6b4a19ed483afff288514e75bd (patch) | |
tree | 126d4afb677ecd531532573f22be95090145f48f /test/libsolidity/ViewPureChecker.cpp | |
parent | 533d5d4b1cc4374decc704de8c86ad4cef6214fc (diff) | |
download | dexon-solidity-8202d512e0bd4e6b4a19ed483afff288514e75bd.tar.gz dexon-solidity-8202d512e0bd4e6b4a19ed483afff288514e75bd.tar.zst dexon-solidity-8202d512e0bd4e6b4a19ed483afff288514e75bd.zip |
Enforcing error on msg.gas and block.blockhash()
Diffstat (limited to 'test/libsolidity/ViewPureChecker.cpp')
-rw-r--r-- | test/libsolidity/ViewPureChecker.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/libsolidity/ViewPureChecker.cpp b/test/libsolidity/ViewPureChecker.cpp index 53761ff2..bb5480b2 100644 --- a/test/libsolidity/ViewPureChecker.cpp +++ b/test/libsolidity/ViewPureChecker.cpp @@ -43,13 +43,11 @@ BOOST_AUTO_TEST_CASE(environment_access) vector<string> view{ "block.coinbase", "block.timestamp", - "block.blockhash(7)", "block.difficulty", "block.number", "block.gaslimit", "blockhash(7)", "gasleft()", - "msg.gas", "msg.value", "msg.sender", "tx.origin", @@ -90,12 +88,11 @@ BOOST_AUTO_TEST_CASE(environment_access) "Statement has no effect." })); - CHECK_WARNING_ALLOW_MULTI( + CHECK_ERROR( "contract C { function f() view public { block.blockhash; } }", - (std::vector<std::string>{ - "Function state mutability can be restricted to pure", - "\"block.blockhash()\" has been deprecated in favor of \"blockhash()\"" - })); + TypeError, + "\"block.blockhash()\" has been deprecated in favor of \"blockhash()\"" + ); } BOOST_AUTO_TEST_CASE(assembly_staticcall) |