MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/pow_tests.cpp:15–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14/* Test calculation of next difficulty target with no constraints applying */
15BOOST_AUTO_TEST_CASE(get_next_work)
16{
17 const auto chainParams = CreateChainParams(*m_node.args, CBaseChainParams::MAIN);
18 int64_t nLastRetargetTime = 1261130161; // Block #30240
19 CBlockIndex pindexLast;
20 pindexLast.nHeight = 32255;
21 pindexLast.nTime = 1262152739; // Block #32255
22 pindexLast.nBits = 0x1d00ffff;
23 BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, chainParams->GetConsensus()), 0x1d00d86aU);
24}
25
26/* Test the constraint on the upper bound for next work */
27BOOST_AUTO_TEST_CASE(get_next_work_pow_limit)

Callers

nothing calls this directly

Calls 13

CreateChainParamsFunction · 0.85
UintToArith256Function · 0.85
CheckProofOfWorkFunction · 0.85
ArithToUint256Function · 0.85
GetBlockProofFunction · 0.85
arith_uint256Class · 0.85
InsecureRandRangeFunction · 0.85
sanity_check_chainparamsFunction · 0.85
GetCompactMethod · 0.80
SetHexMethod · 0.45

Tested by

no test coverage detected