aboutsummaryrefslogtreecommitdiff
path: root/src/test/auxpow_tests.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-12-28 15:04:08 +0000
committerRoss Nicoll <[email protected]>2018-09-19 19:24:06 +0100
commit1be681a1b97b686f838af90682a57f2030d26015 (patch)
treeb2795e4a1d35004dbfd84d49b07bc54413a2a9e1 /src/test/auxpow_tests.cpp
parentChange BIP65/66 enforcement to match Dogecoin (#1403) (diff)
downloaddiscoin-1be681a1b97b686f838af90682a57f2030d26015.tar.xz
discoin-1be681a1b97b686f838af90682a57f2030d26015.zip
Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware * Correct implementation of simplified rewards in parameters * Correct max money * Use base block version in IsSuperMajority() instead of full version * Correct mining of blocks in AuxPoW tests * Add in missing pre-AuxPoW consensus checks
Diffstat (limited to 'src/test/auxpow_tests.cpp')
-rw-r--r--src/test/auxpow_tests.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/auxpow_tests.cpp b/src/test/auxpow_tests.cpp
index 5cb2e3269..ca1a93062 100644
--- a/src/test/auxpow_tests.cpp
+++ b/src/test/auxpow_tests.cpp
@@ -181,7 +181,7 @@ CAuxpowBuilder::buildCoinbaseData(bool header, const std::vector<unsigned char>&
BOOST_AUTO_TEST_CASE(check_auxpow)
{
- const Consensus::Params& params = Params().GetConsensus();
+ const Consensus::Params& params = Params().GetConsensus(371337);
CAuxpowBuilder builder(5, 42);
CAuxPow auxpow;
@@ -333,7 +333,7 @@ mineBlock(CBlockHeader& block, bool ok, int nBits = -1)
block.nNonce = 0;
while (true) {
- const bool nowOk = (UintToArith256(block.GetHash()) <= target);
+ const bool nowOk = (UintToArith256(block.GetPoWHash()) <= target);
if ((ok && nowOk) || (!ok && !nowOk))
break;
@@ -341,16 +341,16 @@ mineBlock(CBlockHeader& block, bool ok, int nBits = -1)
}
if (ok)
- BOOST_CHECK(CheckProofOfWork(block.GetHash(), nBits, Params().GetConsensus()));
+ BOOST_CHECK(CheckProofOfWork(block.GetPoWHash(), nBits, Params().GetConsensus(0)));
else
- BOOST_CHECK(!CheckProofOfWork(block.GetHash(), nBits, Params().GetConsensus()));
+ BOOST_CHECK(!CheckProofOfWork(block.GetPoWHash(), nBits, Params().GetConsensus(0)));
}
BOOST_AUTO_TEST_CASE(auxpow_pow)
{
/* Use regtest parameters to allow mining with easy difficulty. */
SelectParams(CBaseChainParams::REGTEST);
- const Consensus::Params& params = Params().GetConsensus();
+ const Consensus::Params& params = Params().GetConsensus(371337);
const arith_uint256 target = (~arith_uint256(0) >> 1);
CBlockHeader block;