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

Function TestDifficulty

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

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

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 3

GetDifficultyFunction · 0.85
RejectDifficultyMismatchFunction · 0.85

Tested by

no test coverage detected