aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDimitry <winsvega@mail.ru>2016-06-13 22:02:58 +0800
committerchriseth <c@ethdev.com>2016-06-29 05:18:54 +0800
commit603bad34f9ea24a5a202ae7844549171c10c0ea2 (patch)
tree7692dde8d6ff10d0e27c9555318a9160a9237e22 /test
parent874a16bed4232d2c1fb79ee34e1a2e8f3ba89bdf (diff)
downloaddexon-solidity-603bad34f9ea24a5a202ae7844549171c10c0ea2.tar.gz
dexon-solidity-603bad34f9ea24a5a202ae7844549171c10c0ea2.tar.zst
dexon-solidity-603bad34f9ea24a5a202ae7844549171c10c0ea2.zip
style
Diffstat (limited to 'test')
-rw-r--r--test/IPCSocket.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/IPCSocket.cpp b/test/IPCSocket.cpp
index b7b2572b..f89cd335 100644
--- a/test/IPCSocket.cpp
+++ b/test/IPCSocket.cpp
@@ -144,12 +144,10 @@ void RPCSession::test_rewindToBlock(size_t _blockNr)
void RPCSession::test_mineBlocks(int _number)
{
- // Extremely complicated mechanism because sometimes the miner breaks and stops mining.
u256 startBlock = fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString()));
u256 currentBlock = startBlock;
u256 targetBlock = startBlock + _number;
- cout << "MINE" << endl;
- rpcCall("test_mineBlocks", { (targetBlock - startBlock).str() }, true);
+ 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)
@@ -159,6 +157,8 @@ void RPCSession::test_mineBlocks(int _number)
return;
std::this_thread::sleep_for(chrono::milliseconds(10)); //it does not work faster then 10 ms
}
+
+ BOOST_FAIL("Error in test_mineBlocks: block mining timeout!");
}
Json::Value RPCSession::rpcCall(string const& _methodName, vector<string> const& _args, bool _canFail)
@@ -187,8 +187,7 @@ Json::Value RPCSession::rpcCall(string const& _methodName, vector<string> const&
if (_canFail)
return Json::Value();
- Json::Value jsonError = result["error"];
- BOOST_FAIL("Error on JSON-RPC call: " + jsonError["message"].asString());
+ BOOST_FAIL("Error on JSON-RPC call: " + result["error"]["message"].asString());
}
return result["result"];
}