diff options
author | Christian <c@ethdev.com> | 2014-11-26 01:23:39 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-26 22:35:25 +0800 |
commit | aabb54d525942ddf9e4b77c7b41ca560c0aae57d (patch) | |
tree | a7024fe303e8ab40fedff3e7f460ccdcf0a01843 /solidityEndToEndTest.cpp | |
parent | aa0fa2209a93a1410334b46e57bb454a7c4ac4a5 (diff) | |
download | dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar.gz dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar.bz2 dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar.lz dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar.xz dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.tar.zst dexon-solidity-aabb54d525942ddf9e4b77c7b41ca560c0aae57d.zip |
Sending ether.
Diffstat (limited to 'solidityEndToEndTest.cpp')
-rw-r--r-- | solidityEndToEndTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/solidityEndToEndTest.cpp b/solidityEndToEndTest.cpp index 66bb0bd7..80a435d1 100644 --- a/solidityEndToEndTest.cpp +++ b/solidityEndToEndTest.cpp @@ -794,6 +794,21 @@ BOOST_AUTO_TEST_CASE(function_types) BOOST_CHECK(callContractFunction(0, bytes{1}) == toBigEndian(u256(12))); } +BOOST_AUTO_TEST_CASE(send_ether) +{ + char const* sourceCode = "contract test {\n" + " function a(address addr, uint amount) returns (uint ret) {\n" + " addr.send(amount);\n" + " return address(this).balance;\n" + " }\n" + "}\n"; + u256 amount(130); + compileAndRun(sourceCode, amount + 1); + u160 address(23); + BOOST_CHECK(callContractFunction(0, address, amount) == toBigEndian(u256(1))); + BOOST_CHECK_EQUAL(m_state.balance(address), amount); +} + BOOST_AUTO_TEST_SUITE_END() } |