diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-03-23 20:08:14 +0800 |
---|---|---|
committer | CJentzsch <jentzsch.software@gmail.com> | 2015-03-23 20:08:14 +0800 |
commit | aab0ec06781d44eb98fe2798bf813023889aa6b9 (patch) | |
tree | 32a87f84a5d67231ff70bc671af27c87eedfb78e | |
parent | 5d910304b64684a2fdb64077ce23a45c6d00a58c (diff) | |
download | dexon-solidity-aab0ec06781d44eb98fe2798bf813023889aa6b9.tar.gz dexon-solidity-aab0ec06781d44eb98fe2798bf813023889aa6b9.tar.zst dexon-solidity-aab0ec06781d44eb98fe2798bf813023889aa6b9.zip |
add possibility to have in-chain uncles as tests
-rw-r--r-- | blockchain.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/blockchain.cpp b/blockchain.cpp index 0f5eeaee..50ca22c5 100644 --- a/blockchain.cpp +++ b/blockchain.cpp @@ -72,6 +72,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) // create new "genesis" block RLPStream rlpGenesisBlock = createFullBlockFromHeader(biGenesisBlock); biGenesisBlock.verifyInternals(&rlpGenesisBlock.out()); + o["genesisRLP"] = "0x" + toHex(rlpGenesisBlock.out()); // construct blockchain BlockChain bc(rlpGenesisBlock.out(), string(), true); @@ -114,6 +115,15 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) vBiUncles.push_back(vBiUncles[vBiUncles.size()-1]); continue; } + + if (uncleHeaderObj.count("sameAsBlock")) + { + writeBlockHeaderToJson(uncleHeaderObj_pre, vBiBlocks[(size_t)toInt(uncleHeaderObj["sameAsBlock"])]); + aUncleList.push_back(uncleHeaderObj_pre); + vBiUncles.push_back(vBiBlocks[(size_t)toInt(uncleHeaderObj["sameAsBlock"])]); + continue; + } + BlockInfo uncleBlockFromFields = constructBlock(uncleHeaderObj); // make uncle header valid |