diff options
author | chriseth <c@ethdev.com> | 2015-11-29 07:09:15 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-11-29 07:10:07 +0800 |
commit | b97bb086de91e1f834e6e92cfdc8a985a6f761de (patch) | |
tree | 8655252ecda0c90cfd3ab95cd18e6097d8aeff89 /test/libsolidity | |
parent | c806b9bcdb26fe031da94b8cdb270cb3c75b8af9 (diff) | |
download | dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar.gz dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar.bz2 dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar.lz dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar.xz dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.tar.zst dexon-solidity-b97bb086de91e1f834e6e92cfdc8a985a6f761de.zip |
Introduce selfdestruct alias for suicide.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 0b356145..a01b8949 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1483,6 +1483,22 @@ BOOST_AUTO_TEST_CASE(suicide) BOOST_CHECK_EQUAL(m_state.balance(address), amount); } +BOOST_AUTO_TEST_CASE(selfdestruct) +{ + char const* sourceCode = "contract test {\n" + " function a(address receiver) returns (uint ret) {\n" + " selfdestruct(receiver);\n" + " return 10;\n" + " }\n" + "}\n"; + u256 amount(130); + compileAndRun(sourceCode, amount); + u160 address(23); + BOOST_CHECK(callContractFunction("a(address)", address) == bytes()); + BOOST_CHECK(!m_state.addressHasCode(m_contractAddress)); + BOOST_CHECK_EQUAL(m_state.balance(address), amount); +} + BOOST_AUTO_TEST_CASE(sha3) { char const* sourceCode = "contract test {\n" |