aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-18 08:08:20 +0800
committerchriseth <c@ethdev.com>2016-06-29 05:18:55 +0800
commite5db096da9a2bfb3e6445b2d89cf730c7e22dc6d (patch)
tree3e950203ff1b0cb53f81447f1350feb3add0da27 /test/libsolidity/SolidityEndToEndTest.cpp
parent007132a78e5d97e0476e1153b14f0ae63f458b04 (diff)
downloaddexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar.gz
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar.bz2
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar.lz
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar.xz
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.tar.zst
dexon-solidity-e5db096da9a2bfb3e6445b2d89cf730c7e22dc6d.zip
Fix some more tests.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 8689d61e..8dcc878e 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -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)
@@ -2462,8 +2462,7 @@ 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 = balanceAt(m_sender);
BOOST_CHECK(callContractFunction("kill()") == bytes());
@@ -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));