diff options
author | chriseth <chris@ethereum.org> | 2018-07-04 19:56:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-04 19:56:10 +0800 |
commit | 476372243bac932ae876bf24c236d48870be2912 (patch) | |
tree | 126d4afb677ecd531532573f22be95090145f48f /test/libsolidity/ViewPureChecker.cpp | |
parent | 533d5d4b1cc4374decc704de8c86ad4cef6214fc (diff) | |
parent | 8202d512e0bd4e6b4a19ed483afff288514e75bd (diff) | |
download | dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar.gz dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar.bz2 dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar.lz dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar.xz dexon-solidity-476372243bac932ae876bf24c236d48870be2912.tar.zst dexon-solidity-476372243bac932ae876bf24c236d48870be2912.zip |
Merge pull request #4423 from ethereum/enforce_error_gasleft
[BREAKING] Enforce 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) |