From 23e527a3eb142455d2c609e3977d3316be665a75 Mon Sep 17 00:00:00 2001 From: Shoham Chakraborty Date: Tue, 19 Apr 2022 16:54:03 +0800 Subject: [PATCH] Update test case to use blockHeight from tip instead of deprecatedHeight --- src/test/blockencodings_tests.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp index 4e5af15dcad..e9be20fddb8 100644 --- a/src/test/blockencodings_tests.cpp +++ b/src/test/blockencodings_tests.cpp @@ -40,6 +40,7 @@ static CBlock BuildBlockTestCase() { uint256 masternodeID = testMasternodeKeys.begin()->first; uint32_t mintedBlocks(0); int64_t creationHeight; + int64_t blockHeight; CKey minterKey; std::map::const_iterator pos = testMasternodeKeys.find(masternodeID); if (pos == testMasternodeKeys.end()) @@ -60,6 +61,7 @@ static CBlock BuildBlockTestCase() { creationHeight = int64_t(nodePtr->creationHeight); } + blockHeight = tip->nHeight + 1; block.deprecatedHeight = tip->nHeight + 1; block.mintedBlocks = mintedBlocks + 1; block.stakeModifier = pos::ComputeStakeModifier(tip->stakeModifier, minterKey.GetPubKey().GetID()); @@ -81,7 +83,7 @@ static CBlock BuildBlockTestCase() { block.nTime = 0; CheckContextState ctxState; - while (!pos::CheckKernelHash(block.stakeModifier, block.nBits, creationHeight, (int64_t) block.nTime, block.deprecatedHeight, masternodeID, Params().GetConsensus(), {0, 0, 0, 0}, 0, ctxState)) block.nTime++; + while (!pos::CheckKernelHash(block.stakeModifier, block.nBits, creationHeight, (int64_t) block.nTime, blockHeight, masternodeID, Params().GetConsensus(), {0, 0, 0, 0}, 0, ctxState)) block.nTime++; std::shared_ptr pblock = std::make_shared(std::move(block)); auto err = pos::SignPosBlock(pblock, minterKey);