MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / TestDifficulty

Function TestDifficulty

src/test/blockchain_tests.cpp:35–42  ·  view source on GitHub ↗

Given a BlockIndex with the provided nbits, * verify that the expected difficulty results. */

Source from the content-addressed store, hash-verified

33 * verify that the expected difficulty results.
34 */
35static void TestDifficulty(uint32_t nbits, double expected_difficulty)
36{
37 CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);
38 double difficulty = GetDifficulty(block_index);
39 delete block_index;
40
41 RejectDifficultyMismatch(difficulty, expected_difficulty);
42}
43
44BOOST_FIXTURE_TEST_SUITE(blockchain_tests, BasicTestingSetup)
45

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

GetDifficultyFunction · 0.85
RejectDifficultyMismatchFunction · 0.85

Tested by

no test coverage detected