diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-01 03:31:12 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-09-19 18:11:19 +0800 |
commit | ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d (patch) | |
tree | 57f605da80c31affda99ddd7fc1b1ca359535b36 /test | |
parent | 1fc71bd75841850ee04d151e9bfbf938928b276a (diff) | |
download | dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.gz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.bz2 dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.lz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.xz dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.tar.zst dexon-solidity-ed1fd49ab07de1ddad9f3bc2864e17fe21ed993d.zip |
Warn about obsolete sha3/suicide calls
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 2ca3a562..39c47f9c 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4679,7 +4679,7 @@ BOOST_AUTO_TEST_CASE(warn_about_callcode) } } )"; - CHECK_WARNING(text, "\"callcode\" has been deprecated in favour"); + CHECK_WARNING(text, "\"callcode\" has been deprecated in favour of \"delegatecall\""); } BOOST_AUTO_TEST_CASE(no_warn_about_callcode_as_function) @@ -6877,7 +6877,7 @@ BOOST_AUTO_TEST_CASE(tight_packing_literals) } } )"; - CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8."); +// CHECK_WARNING(text, "The type of \"int_const 1\" was inferred as uint8."); text = R"( contract C { function f() pure public returns (bytes32) { @@ -6928,6 +6928,31 @@ BOOST_AUTO_TEST_CASE(non_external_fallback) CHECK_ERROR(text, TypeError, "Fallback function must be defined as \"external\"."); } +BOOST_AUTO_TEST_CASE(warn_about_sha3) +{ + char const* text = R"( + contract test { + function f() pure public { + var x = sha3(uint8(1)); + x; + } + } + )"; + CHECK_WARNING(text, "\"sha3\" has been deprecated in favour of \"keccak256\""); +} + +BOOST_AUTO_TEST_CASE(warn_about_suicide) +{ + char const* text = R"( + contract test { + function f() public { + suicide(1); + } + } + )"; + CHECK_WARNING(text, "\"suicide\" has been deprecated in favour of \"selfdestruct\""); +} + BOOST_AUTO_TEST_SUITE_END() } |