diff options
author | arkpar <arkady.paronyan@gmail.com> | 2015-07-17 02:53:58 +0800 |
---|---|---|
committer | Gav Wood <i@gavwood.com> | 2015-07-20 03:10:14 +0800 |
commit | 522d9f1e46c362967487b7c0aeb986dc0d01bf72 (patch) | |
tree | 3bb35e00dd97486ea63e621ae8872579494a0909 /TestHelper.cpp | |
parent | 32916c3362bf7d10448db56abc0f12ca63d2b60b (diff) | |
download | dexon-solidity-522d9f1e46c362967487b7c0aeb986dc0d01bf72.tar.gz dexon-solidity-522d9f1e46c362967487b7c0aeb986dc0d01bf72.tar.zst dexon-solidity-522d9f1e46c362967487b7c0aeb986dc0d01bf72.zip |
eth working
Diffstat (limited to 'TestHelper.cpp')
-rw-r--r-- | TestHelper.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/TestHelper.cpp b/TestHelper.cpp index 30f32336..c29788b9 100644 --- a/TestHelper.cpp +++ b/TestHelper.cpp @@ -23,6 +23,7 @@ #include <thread> #include <chrono> +#include <libethcore/EthashAux.h> #include <libethereum/Client.h> #include <liblll/Compiler.h> #include <libevm/VMFactory.h> @@ -63,11 +64,17 @@ void connectClients(Client& c1, Client& c2) void mine(State& s, BlockChain const& _bc) { s.commitToMine(_bc); - GenericFarm<Ethash> f; + GenericFarm<EthashProofOfWork> f; bool completed = false; - f.onSolutionFound([&](ProofOfWork::Solution sol) + Ethash::BlockHeader header(s.info); + f.onSolutionFound([&](EthashProofOfWork::Solution sol) { - return completed = s.completeMine<ProofOfWork>(sol); + header.m_mixHash = sol.mixHash; + header.m_nonce = sol.nonce; + RLPStream ret; + header.streamRLP(ret); + s.sealBlock(ret); + return true; }); f.setWork(s.info()); f.startCPU(); @@ -77,9 +84,9 @@ void mine(State& s, BlockChain const& _bc) void mine(BlockInfo& _bi) { - GenericFarm<ProofOfWork> f; + GenericFarm<EthashProofOfWork> f; bool completed = false; - f.onSolutionFound([&](ProofOfWork::Solution sol) + f.onSolutionFound([&](EthashProofOfWork::Solution sol) { _bi.proof = sol; return completed = true; |