aboutsummaryrefslogtreecommitdiffstats
path: root/test/IPCSocket.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-14 06:12:13 +0800
committerchriseth <c@ethdev.com>2016-06-29 05:18:54 +0800
commitce2258b71e632e01b3f50d47704352065cb01b5d (patch)
tree411df1ffa3165770f3dedb867f716237a8299028 /test/IPCSocket.cpp
parent966709b7d7ee70cfc550923e22e17a22556609a4 (diff)
downloaddexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar.gz
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar.bz2
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar.lz
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar.xz
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.tar.zst
dexon-solidity-ce2258b71e632e01b3f50d47704352065cb01b5d.zip
Balance and storage.
Diffstat (limited to 'test/IPCSocket.cpp')
-rw-r--r--test/IPCSocket.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/IPCSocket.cpp b/test/IPCSocket.cpp
index 2c1eb7a6..8dd364bf 100644
--- a/test/IPCSocket.cpp
+++ b/test/IPCSocket.cpp
@@ -118,6 +118,12 @@ string RPCSession::eth_getBalance(string const& _address, string const& _blockNu
return rpcCall("eth_getBalance", { quote(address), quote(_blockNumber) }).asString();
}
+string RPCSession::eth_getStorageRoot(string const& _address, string const& _blockNumber)
+{
+ string address = (_address.length() == 20) ? "0x" + _address : _address;
+ return rpcCall("eth_getStorageRoot", { quote(address), quote(_blockNumber) }).asString();
+}
+
void RPCSession::personal_unlockAccount(string const& _address, string const& _password, int _duration)
{
rpcCall("personal_unlockAccount", { quote(_address), quote(_password), to_string(_duration) });
@@ -154,15 +160,12 @@ void RPCSession::test_rewindToBlock(size_t _blockNr)
void RPCSession::test_mineBlocks(int _number)
{
u256 startBlock = fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString()));
- u256 currentBlock = startBlock;
- u256 targetBlock = startBlock + _number;
rpcCall("test_mineBlocks", { to_string(_number) }, true);
//@TODO do not use polling - but that would probably need a change to the test client
for (size_t polls = 0; polls < 100; ++polls)
{
- currentBlock = fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString()));
- if (currentBlock >= targetBlock)
+ if (fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString())) >= startBlock + _number)
return;
std::this_thread::sleep_for(chrono::milliseconds(10)); //it does not work faster then 10 ms
}