mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-26 23:04:39 +00:00
Fixed unit test blockchain generation.
This commit is contained in:
parent
c301a99642
commit
70df11c1a7
@ -241,6 +241,7 @@ public:
|
||||
block.nTime = nTime;
|
||||
block.nBits = nBits;
|
||||
block.nNonce = nNonce;
|
||||
block.cnHeader = cnHeader;
|
||||
block.SetLegacy(legacyMode);
|
||||
return block;
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ static CBlock BuildBlockTestCase() {
|
||||
bool mutated;
|
||||
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
|
||||
assert(!mutated);
|
||||
block.cnHeader.major_version = Params().GetConsensus().GetCryptonoteMajorVersion();
|
||||
block.cnHeader.prev_id = block.GetHash();
|
||||
while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, Params().GetConsensus())) ++block.cnHeader.nonce;
|
||||
return block;
|
||||
@ -293,6 +294,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||
bool mutated;
|
||||
block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);
|
||||
assert(!mutated);
|
||||
block.cnHeader.major_version = Params().GetConsensus().GetCryptonoteMajorVersion();
|
||||
block.cnHeader.prev_id = block.GetHash();
|
||||
while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, Params().GetConsensus())) ++block.cnHeader.nonce;
|
||||
|
||||
|
@ -154,6 +154,7 @@ TestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>&
|
||||
IncrementExtraNonce(&block, chainActive.Tip(), extraNonce);
|
||||
}
|
||||
|
||||
block.cnHeader.major_version = Params().GetConsensus().GetCryptonoteMajorVersion();
|
||||
block.cnHeader.prev_id = block.GetHash();
|
||||
while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, chainparams.GetConsensus())) ++block.cnHeader.nonce;
|
||||
|
||||
|
@ -71,6 +71,7 @@ std::shared_ptr<CBlock> FinalizeBlock(std::shared_ptr<CBlock> pblock)
|
||||
{
|
||||
pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);
|
||||
|
||||
pblock->cnHeader.major_version = Params().GetConsensus().GetCryptonoteMajorVersion();
|
||||
pblock->cnHeader.prev_id = pblock->GetHash();
|
||||
while (!CheckProofOfWork(pblock->GetPoWHash(), pblock->nBits, Params().GetConsensus())) {
|
||||
++(pblock->cnHeader.nonce);
|
||||
|
Loading…
x
Reference in New Issue
Block a user