aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-06-18 23:06:23 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-06-20 01:31:07 +0800
commita17059573fe2ffce115b5368e798a87ce07dc1cd (patch)
treef4ed43e75f6e1af91159811f570f26b4b6ead818 /test/libsolidity/SolidityEndToEndTest.cpp
parent4189b6b03dfcbcccacb17e4eeed4eaf6cd653002 (diff)
downloaddexon-solidity-a17059573fe2ffce115b5368e798a87ce07dc1cd.tar.gz
dexon-solidity-a17059573fe2ffce115b5368e798a87ce07dc1cd.tar.zst
dexon-solidity-a17059573fe2ffce115b5368e798a87ce07dc1cd.zip
Disallow raw callcode (was deprecated in 0.4.12)
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index c80aa8ba..2a24a1e3 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -3745,38 +3745,6 @@ BOOST_AUTO_TEST_CASE(generic_call)
BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 50 - 2);
}
-BOOST_AUTO_TEST_CASE(generic_callcode)
-{
- char const* sourceCode = R"**(
- contract Receiver {
- uint public received;
- function receive(uint256 x) payable { received = x; }
- }
- contract Sender {
- uint public received;
- function Sender() payable { }
- function doSend(address rec) returns (uint d)
- {
- bytes4 signature = bytes4(bytes32(keccak256("receive(uint256)")));
- rec.callcode.value(2)(signature, 23);
- return Receiver(rec).received();
- }
- }
- )**";
- compileAndRun(sourceCode, 0, "Receiver");
- u160 const c_receiverAddress = m_contractAddress;
- compileAndRun(sourceCode, 50, "Sender");
- u160 const c_senderAddress = m_contractAddress;
- ABI_CHECK(callContractFunction("doSend(address)", c_receiverAddress), encodeArgs(0));
- ABI_CHECK(callContractFunction("received()"), encodeArgs(23));
- m_contractAddress = c_receiverAddress;
- ABI_CHECK(callContractFunction("received()"), encodeArgs(0));
- BOOST_CHECK(storageEmpty(c_receiverAddress));
- BOOST_CHECK(!storageEmpty(c_senderAddress));
- BOOST_CHECK_EQUAL(balanceAt(c_receiverAddress), 0);
- BOOST_CHECK_EQUAL(balanceAt(c_senderAddress), 50);
-}
-
BOOST_AUTO_TEST_CASE(generic_delegatecall)
{
char const* sourceCode = R"**(
@@ -11558,9 +11526,6 @@ BOOST_AUTO_TEST_CASE(bare_call_invalid_address)
function f() external returns (bool) {
return address(0x4242).call();
}
- function g() external returns (bool) {
- return address(0x4242).callcode();
- }
function h() external returns (bool) {
return address(0x4242).delegatecall();
}
@@ -11568,7 +11533,6 @@ BOOST_AUTO_TEST_CASE(bare_call_invalid_address)
)";
compileAndRun(sourceCode, 0, "C");
ABI_CHECK(callContractFunction("f()"), encodeArgs(u256(1)));
- ABI_CHECK(callContractFunction("g()"), encodeArgs(u256(1)));
ABI_CHECK(callContractFunction("h()"), encodeArgs(u256(1)));
}