diff --git a/blockchain.cpp b/blockchain.cpp index ab01df5a5..15cda8037 100644 --- a/blockchain.cpp +++ b/blockchain.cpp @@ -192,7 +192,8 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) state.sync(bc, txs, gp); state.commitToMine(bc); MineInfo info; - for (info.completed = false; !info.completed; info = state.mine()) {} + ProofOfWork pow; + for (info.completed = false; !info.completed; info = state.mine(&pow)) {} state.completeMine(); } catch (Exception const& _e) @@ -577,7 +578,7 @@ void overwriteBlockHeader(BlockInfo& _currentBlockHeader, mObject& _blObj) std::pair ret; while (!ProofOfWork::verify(_currentBlockHeader)) { - ret = pow.mine(_currentBlockHeader, 1000, true, true); + ret = pow.mine(_currentBlockHeader, 1000, true); Ethash::assignResult(ret.second, _currentBlockHeader); } } @@ -623,7 +624,7 @@ void updatePoW(BlockInfo& _bi) std::pair ret; while (!ProofOfWork::verify(_bi)) { - ret = pow.mine(_bi, 10000, true, true); + ret = pow.mine(_bi, 10000, true); Ethash::assignResult(ret.second, _bi); } _bi.noteDirty(); diff --git a/stateOriginal.cpp b/stateOriginal.cpp index 572e84dcf..40f759434 100644 --- a/stateOriginal.cpp +++ b/stateOriginal.cpp @@ -68,7 +68,8 @@ BOOST_AUTO_TEST_CASE(Complex) // Mine to get some ether! s.commitToMine(bc); - while (!s.mine(100, true).completed) {} + ProofOfWork pow; + while (!s.mine(&pow).completed) {} s.completeMine(); bc.attemptImport(s.blockData(), stateDB); @@ -88,7 +89,7 @@ BOOST_AUTO_TEST_CASE(Complex) // Mine to get some ether and set in stone. s.commitToMine(bc); s.commitToMine(bc); - while (!s.mine(100, true).completed) {} + while (!s.mine(&pow).completed) {} s.completeMine(); bc.attemptImport(s.blockData(), stateDB); diff --git a/webthreestubclient.h b/webthreestubclient.h index a460ddda4..c1fdc3411 100644 --- a/webthreestubclient.h +++ b/webthreestubclient.h @@ -72,6 +72,16 @@ class WebThreeStubClient : public jsonrpc::Client else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } + std::string eth_hashrate() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_hashrate",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + } std::string eth_coinbase() throw (jsonrpc::JsonRpcException) { Json::Value p;