diff options
author | chriseth <chris@ethereum.org> | 2018-12-20 01:06:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-20 01:06:13 +0800 |
commit | 1df8f40cd2fd7b47698d847907b8ca7b47eb488d (patch) | |
tree | 5ed5816fe2d1a8a207e750d39884aca7957c8289 /test/RPCSession.cpp | |
parent | c8a2cb62832afb2dc09ccee6fd42c1516dfdb981 (diff) | |
parent | ddf54b21d1d002903624f61173ab4af197f50053 (diff) | |
download | dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.gz dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.bz2 dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.lz dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.xz dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.tar.zst dexon-solidity-1df8f40cd2fd7b47698d847907b8ca7b47eb488d.zip |
Merge pull request #5697 from ethereum/develop
Merge develop into release for 0.5.2
Diffstat (limited to 'test/RPCSession.cpp')
-rw-r--r-- | test/RPCSession.cpp | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 0aae21a7..60848118 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -296,40 +296,7 @@ void RPCSession::test_mineBlocks(int _number) { u256 startBlock = fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString())); BOOST_REQUIRE(rpcCall("test_mineBlocks", { to_string(_number) }, true) == true); - - // We auto-calibrate the time it takes to mine the transaction. - // It would be better to go without polling, but that would probably need a change to the test client - - auto startTime = std::chrono::steady_clock::now(); - unsigned sleepTime = m_sleepTime; - size_t tries = 0; - for (; ; ++tries) - { - std::this_thread::sleep_for(chrono::milliseconds(sleepTime)); - auto endTime = std::chrono::steady_clock::now(); - unsigned timeSpent = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count(); - if (timeSpent > m_maxMiningTime) - BOOST_FAIL("Error in test_mineBlocks: block mining timeout!"); - if (fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString())) >= startBlock + _number) - break; - else - sleepTime *= 2; - } - if (tries > 1) - { - m_successfulMineRuns = 0; - m_sleepTime += 2; - } - else if (tries == 1) - { - m_successfulMineRuns++; - if (m_successfulMineRuns > 5) - { - m_successfulMineRuns = 0; - if (m_sleepTime > 2) - m_sleepTime--; - } - } + BOOST_REQUIRE(fromBigEndian<u256>(fromHex(rpcCall("eth_blockNumber").asString())) == startBlock + _number); } void RPCSession::test_modifyTimestamp(size_t _timestamp) |