Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
test_kernel.cpp File Reference
#include <kernel/bitcoinkernel.h>
#include <kernel/bitcoinkernel_wrapper.h>
#include <util/fs.h>
#include <boost/test/included/unit_test.hpp>
#include <test/kernel/block_data.h>
#include <charconv>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <memory>
#include <optional>
#include <random>
#include <ranges>
#include <span>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for test_kernel.cpp:

Go to the source code of this file.

Classes

class  TestLog
struct  TestDirectory
class  TestKernelNotifications
class  TestValidationInterface

Concepts

concept  HasToBytes

Macros

#define BOOST_TEST_MODULE   Bitcoin Kernel Test Suite

Functions

std::string random_string (uint32_t length)
std::vector< std::byte > hex_string_to_byte_vec (std::string_view hex)
std::string byte_span_to_hex_string_reversed (std::span< const std::byte > bytes)
void check_equal (std::span< const std::byte > _actual, std::span< const std::byte > _expected, bool equal=true)
void run_verify_test (const ScriptPubkey &spent_script_pubkey, const Transaction &spending_tx, const PrecomputedTransactionData *precomputed_txdata, int64_t amount, unsigned int input_index, bool taproot)
template<typename T>
void CheckHandle (T object, T distinct_object)
template<typename RangeType>
void CheckRange (const RangeType &range, size_t expected_size)
 BOOST_AUTO_TEST_CASE (btck_transaction_tests)
 BOOST_AUTO_TEST_CASE (btck_script_pubkey)
 BOOST_AUTO_TEST_CASE (btck_transaction_output)
 BOOST_AUTO_TEST_CASE (btck_transaction_input)
 BOOST_AUTO_TEST_CASE (btck_precomputed_txdata)
 BOOST_AUTO_TEST_CASE (btck_script_verify_tests)
 BOOST_AUTO_TEST_CASE (logging_tests)
 BOOST_AUTO_TEST_CASE (btck_context_tests)
 BOOST_AUTO_TEST_CASE (btck_block_header_tests)
 BOOST_AUTO_TEST_CASE (btck_block)
Context create_context (std::shared_ptr< TestKernelNotifications > notifications, ChainType chain_type, std::shared_ptr< TestValidationInterface > validation_interface=nullptr)
 BOOST_AUTO_TEST_CASE (btck_chainman_tests)
std::unique_ptr< ChainMancreate_chainman (TestDirectory &test_directory, bool reindex, bool wipe_chainstate, bool block_tree_db_in_memory, bool chainstate_db_in_memory, Context &context)
void chainman_reindex_test (TestDirectory &test_directory)
void chainman_reindex_chainstate_test (TestDirectory &test_directory)
void chainman_mainnet_validation_test (TestDirectory &test_directory)
 BOOST_AUTO_TEST_CASE (btck_chainman_mainnet_tests)
 BOOST_AUTO_TEST_CASE (btck_block_hash_tests)
 BOOST_AUTO_TEST_CASE (btck_block_tree_entry_tests)
 BOOST_AUTO_TEST_CASE (btck_chainman_in_memory_tests)
 BOOST_AUTO_TEST_CASE (btck_chainman_regtest_tests)

Variables

constexpr auto VERIFY_ALL_PRE_SEGWIT
constexpr auto VERIFY_ALL_PRE_TAPROOT {VERIFY_ALL_PRE_SEGWIT | ScriptVerificationFlags::WITNESS}

Macro Definition Documentation

◆ BOOST_TEST_MODULE

#define BOOST_TEST_MODULE   Bitcoin Kernel Test Suite

Definition at line 9 of file test_kernel.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/16]

BOOST_AUTO_TEST_CASE ( btck_block )

Definition at line 695 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/16]

BOOST_AUTO_TEST_CASE ( btck_block_hash_tests )

Definition at line 921 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/16]

BOOST_AUTO_TEST_CASE ( btck_block_header_tests )

Definition at line 662 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/16]

BOOST_AUTO_TEST_CASE ( btck_block_tree_entry_tests )

Definition at line 936 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/16]

BOOST_AUTO_TEST_CASE ( btck_chainman_in_memory_tests )

Definition at line 978 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/16]

BOOST_AUTO_TEST_CASE ( btck_chainman_mainnet_tests )

Definition at line 913 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [7/16]

BOOST_AUTO_TEST_CASE ( btck_chainman_regtest_tests )

Definition at line 1002 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [8/16]

BOOST_AUTO_TEST_CASE ( btck_chainman_tests )

Definition at line 721 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [9/16]

BOOST_AUTO_TEST_CASE ( btck_context_tests )

Definition at line 638 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [10/16]

BOOST_AUTO_TEST_CASE ( btck_precomputed_txdata )

Definition at line 502 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [11/16]

BOOST_AUTO_TEST_CASE ( btck_script_pubkey )

Definition at line 468 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [12/16]

BOOST_AUTO_TEST_CASE ( btck_script_verify_tests )

Definition at line 518 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [13/16]

BOOST_AUTO_TEST_CASE ( btck_transaction_input )

Definition at line 490 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [14/16]

BOOST_AUTO_TEST_CASE ( btck_transaction_output )

Definition at line 482 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [15/16]

BOOST_AUTO_TEST_CASE ( btck_transaction_tests )

Definition at line 389 of file test_kernel.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [16/16]

BOOST_AUTO_TEST_CASE ( logging_tests )

Definition at line 612 of file test_kernel.cpp.

Here is the call graph for this function:

◆ byte_span_to_hex_string_reversed()

std::string byte_span_to_hex_string_reversed ( std::span< const std::byte > bytes)

Definition at line 64 of file test_kernel.cpp.

Here is the caller graph for this function:

◆ chainman_mainnet_validation_test()

void chainman_mainnet_validation_test ( TestDirectory & test_directory)

Definition at line 849 of file test_kernel.cpp.

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

◆ chainman_reindex_chainstate_test()

void chainman_reindex_chainstate_test ( TestDirectory & test_directory)

Definition at line 836 of file test_kernel.cpp.

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

◆ chainman_reindex_test()

void chainman_reindex_test ( TestDirectory & test_directory)

Definition at line 791 of file test_kernel.cpp.

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

◆ check_equal()

void check_equal ( std::span< const std::byte > _actual,
std::span< const std::byte > _expected,
bool equal = true )

Definition at line 82 of file test_kernel.cpp.

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

◆ CheckHandle()

template<typename T>
void CheckHandle ( T object,
T distinct_object )

Definition at line 271 of file test_kernel.cpp.

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

◆ CheckRange()

template<typename RangeType>
void CheckRange ( const RangeType & range,
size_t expected_size )

Definition at line 319 of file test_kernel.cpp.

Here is the caller graph for this function:

◆ create_chainman()

std::unique_ptr< ChainMan > create_chainman ( TestDirectory & test_directory,
bool reindex,
bool wipe_chainstate,
bool block_tree_db_in_memory,
bool chainstate_db_in_memory,
Context & context )

Definition at line 765 of file test_kernel.cpp.

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

◆ create_context()

Context create_context ( std::shared_ptr< TestKernelNotifications > notifications,
ChainType chain_type,
std::shared_ptr< TestValidationInterface > validation_interface = nullptr )

Definition at line 708 of file test_kernel.cpp.

Here is the caller graph for this function:

◆ hex_string_to_byte_vec()

std::vector< std::byte > hex_string_to_byte_vec ( std::string_view hex)

Definition at line 47 of file test_kernel.cpp.

Here is the caller graph for this function:

◆ random_string()

std::string random_string ( uint32_t length)

Definition at line 29 of file test_kernel.cpp.

Here is the caller graph for this function:

◆ run_verify_test()

void run_verify_test ( const ScriptPubkey & spent_script_pubkey,
const Transaction & spending_tx,
const PrecomputedTransactionData * precomputed_txdata,
int64_t amount,
unsigned int input_index,
bool taproot )

Definition at line 218 of file test_kernel.cpp.

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

Variable Documentation

◆ VERIFY_ALL_PRE_SEGWIT

auto VERIFY_ALL_PRE_SEGWIT
constexpr
Initial value:
{ScriptVerificationFlags::P2SH | ScriptVerificationFlags::DERSIG |
ScriptVerificationFlags::NULLDUMMY | ScriptVerificationFlags::CHECKLOCKTIMEVERIFY |
ScriptVerificationFlags::CHECKSEQUENCEVERIFY}

Definition at line 77 of file test_kernel.cpp.

◆ VERIFY_ALL_PRE_TAPROOT

auto VERIFY_ALL_PRE_TAPROOT {VERIFY_ALL_PRE_SEGWIT | ScriptVerificationFlags::WITNESS}
constexpr

Definition at line 80 of file test_kernel.cpp.