Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
blockchain_tests.cpp File Reference
#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 <boost/test/unit_test.hpp>
#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 (const node::BlockManager &blockman, const CChain &chain, int height) EXCLUSIVE_LOCKS_REQUIRED(
 BOOST_FIXTURE_TEST_CASE (get_prune_height, TestChain100Setup)
 BOOST_AUTO_TEST_CASE (num_chain_tx_max)
 BOOST_FIXTURE_TEST_CASE (invalidate_block, TestChain100Setup)
template<typename T>
std::string ToString (const T &t)
 Locale-independent version of std::to_string.

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() [1/2]

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:

◆ BOOST_FIXTURE_TEST_CASE() [2/2]

BOOST_FIXTURE_TEST_CASE ( invalidate_block ,
TestChain100Setup  )

Definition at line 120 of file blockchain_tests.cpp.

Here is the call graph for this function:

◆ CheckGetPruneHeight()

void CheckGetPruneHeight ( const node::BlockManager & blockman,
const 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()

CBlockIndex * CreateBlockIndexWithNbits ( uint32_t nbits)
static

Definition at line 26 of file blockchain_tests.cpp.

Here is the caller graph for this function:

◆ DoubleEquals()

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()

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()

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:

◆ ToString()

template<typename T>
std::string util::ToString ( const T & t)

Locale-independent version of std::to_string.

Definition at line 246 of file string.h.

Here is the caller graph for this function: