Bitcoin Core  22.99.0
P2P Digital Currency
Functions
blockchain_tests.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <stdlib.h>
#include <chain.h>
#include <rpc/blockchain.h>
#include <test/util/setup_common.h>
#include <util/string.h>
Include dependency graph for blockchain_tests.cpp:

Go to the source code of this file.

Functions

static bool DoubleEquals (double a, double b, double epsilon)
 
static CBlockIndexCreateBlockIndexWithNbits (uint32_t nbits)
 
static void RejectDifficultyMismatch (double difficulty, double expected_difficulty)
 
static void TestDifficulty (uint32_t nbits, double expected_difficulty)
 
 BOOST_AUTO_TEST_CASE (get_difficulty_for_very_low_target)
 
 BOOST_AUTO_TEST_CASE (get_difficulty_for_low_target)
 
 BOOST_AUTO_TEST_CASE (get_difficulty_for_mid_target)
 
 BOOST_AUTO_TEST_CASE (get_difficulty_for_high_target)
 
 BOOST_AUTO_TEST_CASE (get_difficulty_for_very_high_target)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/5]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_high_target  )

Definition at line 67 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/5]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_low_target  )

Definition at line 57 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/5]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_mid_target  )

Definition at line 62 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/5]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_very_high_target  )

Definition at line 72 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/5]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_very_low_target  )

Definition at line 52 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ CreateBlockIndexWithNbits()

static CBlockIndex* CreateBlockIndexWithNbits ( uint32_t  nbits)
static

Definition at line 22 of file blockchain_tests.cpp.

Here is the caller graph for this function:

◆ DoubleEquals()

static bool DoubleEquals ( double  a,
double  b,
double  epsilon 
)
static

Definition at line 17 of file blockchain_tests.cpp.

Here is the caller graph for this function:

◆ RejectDifficultyMismatch()

static void RejectDifficultyMismatch ( double  difficulty,
double  expected_difficulty 
)
static

Definition at line 31 of file blockchain_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TestDifficulty()

static void TestDifficulty ( uint32_t  nbits,
double  expected_difficulty 
)
static

Definition at line 41 of file blockchain_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: