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

Function TestDifficulty

src/test/blockchain_tests.cpp:45–52  ·  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

43 * verify that the expected difficulty results.
44 */
45static void TestDifficulty(uint32_t nbits, double expected_difficulty)
46{
47 CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);
48 double difficulty = GetDifficulty(*block_index);
49 delete block_index;
50
51 RejectDifficultyMismatch(difficulty, expected_difficulty);
52}
53
54BOOST_FIXTURE_TEST_SUITE(blockchain_tests, BasicTestingSetup)
55

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

GetDifficultyFunction · 0.85
RejectDifficultyMismatchFunction · 0.85

Tested by

no test coverage detected