|
|
@ -22,7 +22,7 @@ BOOST_AUTO_TEST_CASE(get_next_work) |
|
|
|
int64_t nLastRetargetTime = 1262149169; // NOTE: Not an actual block time
|
|
|
|
CBlockIndex pindexLast; |
|
|
|
pindexLast.nHeight = 32255; |
|
|
|
pindexLast.nTime = 1262152739; // Block #32255
|
|
|
|
pindexLast.nTime = 1262152739; // Block #32255 of Bitcoin
|
|
|
|
pindexLast.nBits = 0x1d00ffff; |
|
|
|
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1d011998); |
|
|
|
} |
|
|
@ -33,10 +33,10 @@ BOOST_AUTO_TEST_CASE(get_next_work_pow_limit) |
|
|
|
SelectParams(CBaseChainParams::MAIN); |
|
|
|
const Consensus::Params& params = Params().GetConsensus(); |
|
|
|
|
|
|
|
int64_t nLastRetargetTime = 1231006505; // Block #0
|
|
|
|
int64_t nLastRetargetTime = 1231006505; // Block #0 of Bitcoin
|
|
|
|
CBlockIndex pindexLast; |
|
|
|
pindexLast.nHeight = 2015; |
|
|
|
pindexLast.nTime = 1233061996; // Block #2015
|
|
|
|
pindexLast.nTime = 1233061996; // Block #2015 of Bitcoin
|
|
|
|
// TODO change once the harder genesis block is generated
|
|
|
|
pindexLast.nBits = 0x207fffff; |
|
|
|
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x207fffff); |
|
|
@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(get_next_work_lower_limit_actual) |
|
|
|
int64_t nLastRetargetTime = 1279295950; // NOTE: Not an actual block time
|
|
|
|
CBlockIndex pindexLast; |
|
|
|
pindexLast.nHeight = 68543; |
|
|
|
pindexLast.nTime = 1279297671; // Block #68543
|
|
|
|
pindexLast.nTime = 1279297671; // Block #68543 of Bitcoin
|
|
|
|
pindexLast.nBits = 0x1c05a3f4; |
|
|
|
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c05306f); |
|
|
|
} |
|
|
@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(get_next_work_upper_limit_actual) |
|
|
|
int64_t nLastRetargetTime = 1269207250; // NOTE: Not an actual block time
|
|
|
|
CBlockIndex pindexLast; |
|
|
|
pindexLast.nHeight = 46367; |
|
|
|
pindexLast.nTime = 1269211443; // Block #46367
|
|
|
|
pindexLast.nTime = 1269211443; // Block #46367 of Bitcoin
|
|
|
|
pindexLast.nBits = 0x1c387f6f; |
|
|
|
BOOST_CHECK_EQUAL(CalculateNextWorkRequired(&pindexLast, nLastRetargetTime, params), 0x1c418995); |
|
|
|
} |
|
|
|