diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-24 08:27:36 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-02-24 08:27:36 +0800 |
commit | 4d290e551c2d563671f9d56744883d3f3dff98ec (patch) | |
tree | 9f4a581d0fb76d744a242678bc6dba1c2d5882a9 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 59514d8268585f02aa1abb1fdb1b56bcf6e56ef4 (diff) | |
download | dexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.tar.gz dexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.tar.zst dexon-solidity-4d290e551c2d563671f9d56744883d3f3dff98ec.zip |
Disallow setting .gas() on .transfer()
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index f77a8935..cb0cc168 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1693,10 +1693,6 @@ BOOST_AUTO_TEST_CASE(transfer_ether) function b(address addr, uint amount) { addr.transfer(amount); } - function c(address addr, uint amount, uint gas) returns (uint) { - addr.transfer.gas(gas)(amount); - return this.balance; - } } contract B { @@ -1707,22 +1703,11 @@ BOOST_AUTO_TEST_CASE(transfer_ether) throw; } } - - contract D { - // This takes about ~3600 gas, which exceeds the 2300 gas stipend. - function () payable { - bytes32 tmp = 1; - for (uint i = 0; i < 20; i++) - tmp = sha3(tmp); - } - } )"; compileAndRun(sourceCode, 0, "B"); u160 const nonPayableRecipient = m_contractAddress; compileAndRun(sourceCode, 0, "C"); u160 const oogRecipient = m_contractAddress; - compileAndRun(sourceCode, 0, "D"); - u160 const expensiveRecipient = m_contractAddress; compileAndRun(sourceCode, 20, "A"); u160 payableRecipient(23); BOOST_CHECK(callContractFunction("a(address,uint256)", payableRecipient, 10) == encodeArgs(10)); @@ -1730,8 +1715,6 @@ BOOST_AUTO_TEST_CASE(transfer_ether) BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 10); BOOST_CHECK(callContractFunction("b(address,uint256)", nonPayableRecipient, 10) == encodeArgs()); BOOST_CHECK(callContractFunction("b(address,uint256)", oogRecipient, 10) == encodeArgs()); - BOOST_CHECK(callContractFunction("c(address,uint256,uint256)", expensiveRecipient, 1, 9000) == encodeArgs(9)); - BOOST_CHECK(callContractFunction("c(address,uint256,uint256)", expensiveRecipient, 1, 0) == encodeArgs()); } BOOST_AUTO_TEST_CASE(log0) |