Bitcoin Core 28.99.0
P2P Digital Currency
Functions
blockchain_tests.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <chain.h>
#include <node/blockstorage.h>
#include <rpc/blockchain.h>
#include <sync.h>
#include <test/util/setup_common.h>
#include <util/string.h>
#include <cstdlib>
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)
 
static void CheckGetPruneHeight (node::BlockManager &blockman, CChain &chain, int height) EXCLUSIVE_LOCKS_REQUIRED(
 Prune chain from height down to genesis block and check that GetPruneHeight returns the correct value. More...
 
 BOOST_FIXTURE_TEST_CASE (get_prune_height, TestChain100Setup)
 
 BOOST_AUTO_TEST_CASE (num_chain_tx_max)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_high_target  )

Definition at line 71 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_low_target  )

Definition at line 61 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_mid_target  )

Definition at line 66 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_very_high_target  )

Definition at line 76 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( get_difficulty_for_very_low_target  )

Definition at line 56 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( num_chain_tx_max  )

Definition at line 113 of file blockchain_tests.cpp.

◆ BOOST_FIXTURE_TEST_CASE()

BOOST_FIXTURE_TEST_CASE ( get_prune_height  ,
TestChain100Setup   
)

Definition at line 98 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ CheckGetPruneHeight()

static void CheckGetPruneHeight ( node::BlockManager blockman,
CChain chain,
int  height 
)
static

Prune chain from height down to genesis block and check that GetPruneHeight returns the correct value.

Definition at line 83 of file blockchain_tests.cpp.

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

◆ CreateBlockIndexWithNbits()

static CBlockIndex * CreateBlockIndexWithNbits ( uint32_t  nbits)
static

Definition at line 26 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 21 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 35 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 45 of file blockchain_tests.cpp.

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