diff options
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 159 |
1 files changed, 79 insertions, 80 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 07bf6759..8dcc878e 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -26,7 +26,7 @@ #include <boost/test/unit_test.hpp> #include <libdevcore/Hash.h> #include <libsolidity/interface/Exceptions.h> -#include <test/libsolidity/solidityExecutionFramework.h> +#include <test/libsolidity/SolidityExecutionFramework.h> using namespace std; @@ -1325,10 +1325,10 @@ BOOST_AUTO_TEST_CASE(blockchain) " blockNumber = block.number;\n" " }\n" "}\n"; - m_envInfo.setAuthor(Address(0x123)); - m_envInfo.setNumber(7); + BOOST_CHECK(m_rpc.rpcCall("miner_setEtherbase", {"\"0x1212121212121212121212121212121212121212\""}).asBool() == true); + m_rpc.test_mineBlocks(5); compileAndRun(sourceCode, 27); - BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, 0x123, 7)); + BOOST_CHECK(callContractFunctionWithValue("someInfo()", 28) == encodeArgs(28, u256("0x1212121212121212121212121212121212121212"), 7)); } BOOST_AUTO_TEST_CASE(msg_sig) @@ -1368,9 +1368,9 @@ BOOST_AUTO_TEST_CASE(now) " val = now;\n" " }\n" "}\n"; - m_envInfo.setTimestamp(9); + m_rpc.test_modifyTimestamp(0x776347e2); compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction("someInfo()") == encodeArgs(true, 9)); + BOOST_CHECK(callContractFunction("someInfo()") == encodeArgs(true, 0x776347e3)); } BOOST_AUTO_TEST_CASE(type_conversions_cleanup) @@ -1541,7 +1541,7 @@ BOOST_AUTO_TEST_CASE(send_ether) compileAndRun(sourceCode, amount + 1); u160 address(23); BOOST_CHECK(callContractFunction("a(address,uint256)", address, amount) == encodeArgs(1)); - BOOST_CHECK_EQUAL(m_state.balance(address), amount); + BOOST_CHECK_EQUAL(balanceAt(address), amount); } BOOST_AUTO_TEST_CASE(log0) @@ -1553,7 +1553,7 @@ BOOST_AUTO_TEST_CASE(log0) "}\n"; compileAndRun(sourceCode); callContractFunction("a()"); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 0); @@ -1568,10 +1568,10 @@ BOOST_AUTO_TEST_CASE(log1) "}\n"; compileAndRun(sourceCode); callContractFunction("a()"); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); - BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].topics[0], h256(u256(2))); } @@ -1584,10 +1584,10 @@ BOOST_AUTO_TEST_CASE(log2) "}\n"; compileAndRun(sourceCode); callContractFunction("a()"); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); - BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 2); + BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 2); for (unsigned i = 0; i < 2; ++i) BOOST_CHECK_EQUAL(m_logs[0].topics[i], h256(u256(i + 2))); } @@ -1601,10 +1601,10 @@ BOOST_AUTO_TEST_CASE(log3) "}\n"; compileAndRun(sourceCode); callContractFunction("a()"); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); - BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 3); + BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 3); for (unsigned i = 0; i < 3; ++i) BOOST_CHECK_EQUAL(m_logs[0].topics[i], h256(u256(i + 2))); } @@ -1618,10 +1618,10 @@ BOOST_AUTO_TEST_CASE(log4) "}\n"; compileAndRun(sourceCode); callContractFunction("a()"); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); - BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 4); + BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 4); for (unsigned i = 0; i < 4; ++i) BOOST_CHECK_EQUAL(m_logs[0].topics[i], h256(u256(i + 2))); } @@ -1634,10 +1634,10 @@ BOOST_AUTO_TEST_CASE(log_in_constructor) " }\n" "}\n"; compileAndRun(sourceCode); - BOOST_CHECK_EQUAL(m_logs.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(1))); - BOOST_CHECK_EQUAL(m_logs[0].topics.size(), 1); + BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 1); BOOST_CHECK_EQUAL(m_logs[0].topics[0], h256(u256(2))); } @@ -1653,8 +1653,8 @@ BOOST_AUTO_TEST_CASE(suicide) 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_CHECK(!addressHasCode(m_contractAddress)); + BOOST_CHECK_EQUAL(balanceAt(address), amount); } BOOST_AUTO_TEST_CASE(selfdestruct) @@ -1669,8 +1669,8 @@ BOOST_AUTO_TEST_CASE(selfdestruct) 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_CHECK(!addressHasCode(m_contractAddress)); + BOOST_CHECK_EQUAL(balanceAt(address), amount); } BOOST_AUTO_TEST_CASE(sha3) @@ -2462,13 +2462,12 @@ BOOST_AUTO_TEST_CASE(use_std_lib) contract Icarus is mortal { } )"; m_addStandardSources = true; - u256 amount(130); - u160 address(23); + u256 amount(130 * eth::ether); compileAndRun(sourceCode, amount, "Icarus"); - u256 balanceBefore = m_state.balance(m_sender); + u256 balanceBefore = balanceAt(m_sender); BOOST_CHECK(callContractFunction("kill()") == bytes()); - BOOST_CHECK(!m_state.addressHasCode(m_contractAddress)); - BOOST_CHECK(m_state.balance(m_sender) > balanceBefore); + BOOST_CHECK(!addressHasCode(m_contractAddress)); + BOOST_CHECK(balanceAt(m_sender) > balanceBefore); } BOOST_AUTO_TEST_CASE(crazy_elementary_typenames_on_stack) @@ -2567,7 +2566,7 @@ BOOST_AUTO_TEST_CASE(event) BOOST_CHECK_EQUAL(h256(m_logs[0].data), h256(u256(value))); BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 3); BOOST_CHECK_EQUAL(m_logs[0].topics[0], dev::sha3(string("Deposit(address,bytes32,uint256)"))); - BOOST_CHECK_EQUAL(m_logs[0].topics[1], h256(m_sender)); + BOOST_CHECK_EQUAL(m_logs[0].topics[1], h256(m_sender, h256::AlignRight)); BOOST_CHECK_EQUAL(m_logs[0].topics[2], h256(id)); } } @@ -2624,7 +2623,7 @@ BOOST_AUTO_TEST_CASE(event_anonymous_with_topics) BOOST_CHECK_EQUAL(m_logs[0].address, m_contractAddress); BOOST_CHECK(m_logs[0].data == encodeArgs("abc")); BOOST_REQUIRE_EQUAL(m_logs[0].topics.size(), 4); - BOOST_CHECK_EQUAL(m_logs[0].topics[0], h256(m_sender)); + BOOST_CHECK_EQUAL(m_logs[0].topics[0], h256(m_sender, h256::AlignRight)); BOOST_CHECK_EQUAL(m_logs[0].topics[1], h256(id)); BOOST_CHECK_EQUAL(m_logs[0].topics[2], h256(value)); BOOST_CHECK_EQUAL(m_logs[0].topics[3], h256(2)); @@ -2876,7 +2875,7 @@ BOOST_AUTO_TEST_CASE(generic_call) u160 const c_receiverAddress = m_contractAddress; compileAndRun(sourceCode, 50, "sender"); BOOST_REQUIRE(callContractFunction("doSend(address)", c_receiverAddress) == encodeArgs(23)); - BOOST_CHECK_EQUAL(m_state.balance(m_contractAddress), 50 - 2); + BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 50 - 2); } BOOST_AUTO_TEST_CASE(generic_callcode) @@ -2904,10 +2903,10 @@ BOOST_AUTO_TEST_CASE(generic_callcode) BOOST_CHECK(callContractFunction("received()") == encodeArgs(23)); m_contractAddress = c_receiverAddress; BOOST_CHECK(callContractFunction("received()") == encodeArgs(0)); - BOOST_CHECK(m_state.storage(c_receiverAddress).empty()); - BOOST_CHECK(!m_state.storage(c_senderAddress).empty()); - BOOST_CHECK_EQUAL(m_state.balance(c_receiverAddress), 0); - BOOST_CHECK_EQUAL(m_state.balance(c_senderAddress), 50); + 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) @@ -2943,10 +2942,10 @@ BOOST_AUTO_TEST_CASE(generic_delegatecall) BOOST_CHECK(callContractFunction("received()") == encodeArgs(u256(0))); BOOST_CHECK(callContractFunction("sender()") == encodeArgs(u256(0))); BOOST_CHECK(callContractFunction("value()") == encodeArgs(u256(0))); - BOOST_CHECK(m_state.storage(c_receiverAddress).empty()); - BOOST_CHECK(!m_state.storage(c_senderAddress).empty()); - BOOST_CHECK_EQUAL(m_state.balance(c_receiverAddress), 0); - BOOST_CHECK_EQUAL(m_state.balance(c_senderAddress), 50 + 11); + BOOST_CHECK(storageEmpty(c_receiverAddress)); + BOOST_CHECK(!storageEmpty(c_senderAddress)); + BOOST_CHECK_EQUAL(balanceAt(c_receiverAddress), 0); + BOOST_CHECK_EQUAL(balanceAt(c_senderAddress), 50 + 11); } BOOST_AUTO_TEST_CASE(library_call_in_homestead) @@ -3073,9 +3072,9 @@ BOOST_AUTO_TEST_CASE(delete_removes_bytes_data) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("---", 7) == bytes()); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("del()", 7) == encodeArgs(true)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(copy_from_calldata_removes_bytes_data) @@ -3089,10 +3088,10 @@ BOOST_AUTO_TEST_CASE(copy_from_calldata_removes_bytes_data) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("set()", 1, 2, 3, 4, 5) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); sendMessage(bytes(), false); BOOST_CHECK(m_output == bytes()); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(copy_removes_bytes_data) @@ -3107,9 +3106,9 @@ BOOST_AUTO_TEST_CASE(copy_removes_bytes_data) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("set()", 1, 2, 3, 4, 5) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("reset()") == encodeArgs(true)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(bytes_inside_mappings) @@ -3125,15 +3124,15 @@ BOOST_AUTO_TEST_CASE(bytes_inside_mappings) // store a short byte array at 1 and a longer one at 2 BOOST_CHECK(callContractFunction("set(uint256)", 1, 2) == encodeArgs(true)); BOOST_CHECK(callContractFunction("set(uint256)", 2, 2, 3, 4, 5) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); // copy shorter to longer BOOST_CHECK(callContractFunction("copy(uint256,uint256)", 1, 2) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); // copy empty to both BOOST_CHECK(callContractFunction("copy(uint256,uint256)", 99, 1) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("copy(uint256,uint256)", 99, 2) == encodeArgs(true)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(bytes_length_member) @@ -3216,15 +3215,15 @@ BOOST_AUTO_TEST_CASE(struct_containing_bytes_copy_and_delete) )"; compileAndRun(sourceCode); string data = "123456789012345678901234567890123"; - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("set(uint256,bytes,uint256)", 12, u256(data.length()), 13, data) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("copy()") == encodeArgs(true)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("set(uint256,bytes,uint256)", 12, u256(data.length()), 13, data) == encodeArgs(true)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("del()") == encodeArgs(true)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(struct_copy_via_local) @@ -3496,11 +3495,11 @@ BOOST_AUTO_TEST_CASE(fixed_array_cleanup) } )"; compileAndRun(sourceCode); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("fill()") == bytes()); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("clear()") == bytes()); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(short_fixed_array_cleanup) @@ -3517,11 +3516,11 @@ BOOST_AUTO_TEST_CASE(short_fixed_array_cleanup) } )"; compileAndRun(sourceCode); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("fill()") == bytes()); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("clear()") == bytes()); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(dynamic_array_cleanup) @@ -3539,13 +3538,13 @@ BOOST_AUTO_TEST_CASE(dynamic_array_cleanup) } )"; compileAndRun(sourceCode); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("fill()") == bytes()); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("halfClear()") == bytes()); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("fullClear()") == bytes()); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(dynamic_multi_array_cleanup) @@ -3565,11 +3564,11 @@ BOOST_AUTO_TEST_CASE(dynamic_multi_array_cleanup) } )"; compileAndRun(sourceCode); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("fill()") == encodeArgs(8)); - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("clear()") == bytes()); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(array_copy_storage_storage_dyn_dyn) @@ -3594,7 +3593,7 @@ BOOST_AUTO_TEST_CASE(array_copy_storage_storage_dyn_dyn) BOOST_CHECK(callContractFunction("setData1(uint256,uint256,uint256)", 0, 0, 0) == bytes()); BOOST_CHECK(callContractFunction("copyStorageStorage()") == bytes()); BOOST_CHECK(callContractFunction("getData2(uint256)", 0) == encodeArgs(0, 0)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(array_copy_storage_storage_static_static) @@ -3775,7 +3774,7 @@ BOOST_AUTO_TEST_CASE(array_copy_storage_storage_struct) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("test()") == encodeArgs(4, 5)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(array_push) @@ -3992,9 +3991,9 @@ BOOST_AUTO_TEST_CASE(array_copy_including_mapping) compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("test()") == encodeArgs(0x02000200)); // storage is not empty because we cannot delete the mappings - BOOST_CHECK(!m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(!storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("clear()") == encodeArgs(7)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(pass_dynamic_arguments_to_the_base) @@ -4204,7 +4203,7 @@ BOOST_AUTO_TEST_CASE(packed_storage_structs_delete) )"; compileAndRun(sourceCode); BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(overloaded_function_call_resolve_to_first) @@ -5890,11 +5889,11 @@ BOOST_AUTO_TEST_CASE(short_strings) compileAndRun(sourceCode, 0, "A"); BOOST_CHECK(callContractFunction("data1()") == encodeDyn(string("123"))); BOOST_CHECK(callContractFunction("lengthChange()") == encodeArgs(u256(0))); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("deleteElements()") == encodeArgs(u256(0))); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); BOOST_CHECK(callContractFunction("copy()") == encodeArgs(u256(0))); - BOOST_CHECK(m_state.storage(m_contractAddress).empty()); + BOOST_CHECK(storageEmpty(m_contractAddress)); } BOOST_AUTO_TEST_CASE(calldata_offset) @@ -5950,14 +5949,14 @@ BOOST_AUTO_TEST_CASE(reject_ether_sent_to_library) compileAndRun(sourceCode, 0, "lib"); Address libraryAddress = m_contractAddress; compileAndRun(sourceCode, 10, "c"); - BOOST_CHECK_EQUAL(m_state.balance(m_contractAddress), 10); - BOOST_CHECK_EQUAL(m_state.balance(libraryAddress), 0); + BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 10); + BOOST_CHECK_EQUAL(balanceAt(libraryAddress), 0); BOOST_CHECK(callContractFunction("f(address)", encodeArgs(u160(libraryAddress))) == encodeArgs(false)); - BOOST_CHECK_EQUAL(m_state.balance(m_contractAddress), 10); - BOOST_CHECK_EQUAL(m_state.balance(libraryAddress), 0); + BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 10); + BOOST_CHECK_EQUAL(balanceAt(libraryAddress), 0); BOOST_CHECK(callContractFunction("f(address)", encodeArgs(u160(m_contractAddress))) == encodeArgs(true)); - BOOST_CHECK_EQUAL(m_state.balance(m_contractAddress), 10); - BOOST_CHECK_EQUAL(m_state.balance(libraryAddress), 0); + BOOST_CHECK_EQUAL(balanceAt(m_contractAddress), 10); + BOOST_CHECK_EQUAL(balanceAt(libraryAddress), 0); } BOOST_AUTO_TEST_CASE(multi_variable_declaration) |