diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-03-11 15:33:52 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-03-11 15:33:52 +0800 |
commit | 68db4681c0ff2a0c724512edac5abe1fb5341444 (patch) | |
tree | f5528939cd3d4b1cadc9b409d6d062cb190ea07a /blockchain.cpp | |
parent | 57e6fb303dd65212855ea69f2bd25358f0379526 (diff) | |
parent | e9db858ccabbdaa90ed721065b7ace48d3e34bd5 (diff) | |
download | dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar.gz dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar.bz2 dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar.lz dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar.xz dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.tar.zst dexon-solidity-68db4681c0ff2a0c724512edac5abe1fb5341444.zip |
Merge branch 'develop' into new_jsonrpc
Diffstat (limited to 'blockchain.cpp')
-rw-r--r-- | blockchain.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/blockchain.cpp b/blockchain.cpp index 0e1128ef..eca08d09 100644 --- a/blockchain.cpp +++ b/blockchain.cpp @@ -52,6 +52,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) ImportTest importer(o["pre"].get_obj()); State state(Address(), OverlayDB(), BaseState::Empty); importer.importState(o["pre"].get_obj(), state); + o["pre"] = fillJsonWithState(state); state.commit(); if (_fillin) @@ -87,7 +88,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) // get txs TransactionQueue txs; - TrivialGasPricer gp; + ZeroGasPricer gp; BOOST_REQUIRE(blObj.count("transactions")); for (auto const& txObj: blObj["transactions"].get_array()) { @@ -101,10 +102,18 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) BlockQueue uncleBlockQueue; mArray aUncleList; vector<BlockInfo> vBiUncles; + mObject uncleHeaderObj_pre; for (auto const& uHObj: blObj["uncleHeaders"].get_array()) { mObject uncleHeaderObj = uHObj.get_obj(); + if (uncleHeaderObj.count("sameAsPreviousSibling")) + { + writeBlockHeaderToJson(uncleHeaderObj_pre, vBiUncles[vBiUncles.size()-1]); + aUncleList.push_back(uncleHeaderObj_pre); + vBiUncles.push_back(vBiUncles[vBiUncles.size()-1]); + continue; + } BlockInfo uncleBlockFromFields = constructBlock(uncleHeaderObj); // make uncle header valid @@ -123,6 +132,8 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) cnote << "import uncle in blockQueue"; RLPStream uncle = createFullBlockFromHeader(uncleBlockFromFields); uncleBlockQueue.import(&uncle.out(), bc); + + uncleHeaderObj_pre = uncleHeaderObj; } blObj["uncleHeaders"] = aUncleList; @@ -579,6 +590,7 @@ void updatePoW(BlockInfo& _bi) ret = pow.mine(_bi, 10000, true, true); // tie(ret, blockFromFields.nonce) Ethash::assignResult(ret.second, _bi); } + _bi.hash = _bi.headerHash(WithNonce); } void writeBlockHeaderToJson(mObject& _o, const BlockInfo& _bi) |