Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
setup_common.cpp File Reference
#include <test/util/setup_common.h>
#include <addrman.h>
#include <banman.h>
#include <chainparams.h>
#include <common/system.h>
#include <consensus/consensus.h>
#include <consensus/params.h>
#include <consensus/validation.h>
#include <crypto/sha256.h>
#include <init.h>
#include <init/common.h>
#include <interfaces/chain.h>
#include <kernel/mempool_entry.h>
#include <logging.h>
#include <net.h>
#include <net_processing.h>
#include <node/blockstorage.h>
#include <node/chainstate.h>
#include <node/context.h>
#include <node/kernel_notifications.h>
#include <node/mempool_args.h>
#include <node/miner.h>
#include <node/peerman_args.h>
#include <node/warnings.h>
#include <noui.h>
#include <policy/fees/block_policy_estimator.h>
#include <pow.h>
#include <random.h>
#include <rpc/blockchain.h>
#include <rpc/register.h>
#include <rpc/server.h>
#include <scheduler.h>
#include <script/sigcache.h>
#include <streams.h>
#include <test/util/coverage.h>
#include <test/util/transaction_utils.h>
#include <test/util/txmempool.h>
#include <txdb.h>
#include <util/chaintype.h>
#include <util/check.h>
#include <util/fs_helpers.h>
#include <util/rbf.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/task_runner.h>
#include <util/thread.h>
#include <util/threadnames.h>
#include <util/time.h>
#include <util/translation.h>
#include <util/vector.h>
#include <validation.h>
#include <validationinterface.h>
#include <walletinitinterface.h>
#include <algorithm>
#include <future>
#include <functional>
#include <stdexcept>

Go to the source code of this file.

Classes

struct  NetworkSetup

Functions

void SetupCommonTestArgs (ArgsManager &argsman)
 Register common test args.
static void ExitFailure (std::string_view str_err)
 Test setup failure.
CBlock getBlock13b8a ()
util::Result< void > ApplyArgsManOptions (const ArgsManager &args, BlockManager::Options &opts)
ChainstateLoadResult LoadChainstate (ChainstateManager &chainman, const CacheSizes &cache_sizes, const ChainstateLoadOptions &options)
void RegenerateCommitments (CBlock &block, ChainstateManager &chainman)
 Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed.
ChainstateLoadResult VerifyLoadedChainstate (ChainstateManager &chainman, const ChainstateLoadOptions &options)

Variables

const TranslateFn G_TRANSLATION_FUN {nullptr}
 Translate string to current locale using Qt.
constexpr auto TEST_DIR_PATH_ELEMENT {"test_common bitcoin"}
static FastRandomContext g_rng_temp_path
 Random context to get unique temp data dirs.
static const bool g_rng_temp_path_init
static NetworkSetup g_networksetup_instance

Function Documentation

◆ ApplyArgsManOptions()

util::Result< void > node::ApplyArgsManOptions ( const ArgsManager & args,
BlockManager::Options & opts )
nodiscard

Definition at line 18 of file blockmanager_args.cpp.

◆ ExitFailure()

void ExitFailure ( std::string_view str_err)
static

Test setup failure.

Definition at line 107 of file setup_common.cpp.

Here is the caller graph for this function:

◆ getBlock13b8a()

CBlock getBlock13b8a ( )
Returns
a real block (0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af) with 9 txs.

Definition at line 614 of file setup_common.cpp.

Here is the caller graph for this function:

◆ LoadChainstate()

ChainstateLoadResult node::LoadChainstate ( ChainstateManager & chainman,
const CacheSizes & cache_sizes,
const ChainstateLoadOptions & options )

Definition at line 151 of file chainstate.cpp.

◆ RegenerateCommitments()

void node::RegenerateCommitments ( CBlock & block,
ChainstateManager & chainman )

Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed.

Definition at line 67 of file miner.cpp.

◆ SetupCommonTestArgs()

void SetupCommonTestArgs ( ArgsManager & argsman)

Register common test args.

Shared across binaries that rely on the test framework.

Definition at line 100 of file setup_common.cpp.

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

◆ VerifyLoadedChainstate()

ChainstateLoadResult node::VerifyLoadedChainstate ( ChainstateManager & chainman,
const ChainstateLoadOptions & options )

Definition at line 240 of file chainstate.cpp.

Variable Documentation

◆ g_networksetup_instance

NetworkSetup g_networksetup_instance
static

Definition at line 98 of file setup_common.cpp.

◆ g_rng_temp_path

FastRandomContext g_rng_temp_path
static

Random context to get unique temp data dirs.

Separate from m_rng, which can be seeded from a const env var

Definition at line 81 of file setup_common.cpp.

◆ g_rng_temp_path_init

const bool g_rng_temp_path_init
static
Initial value:
{[] {
(void)g_rng_temp_path.rand64();
g_used_g_prng = false;
return true;
}()}
#define Assert(val)
Identity function.
Definition check.h:113
void ResetCoverageCounters()
Definition coverage.cpp:21
std::atomic< bool > g_used_g_prng
Definition random.cpp:599
static FastRandomContext g_rng_temp_path
Random context to get unique temp data dirs.

Definition at line 82 of file setup_common.cpp.

◆ G_TRANSLATION_FUN

const TranslateFn G_TRANSLATION_FUN {nullptr}

Translate string to current locale using Qt.

Definition at line 77 of file setup_common.cpp.

◆ TEST_DIR_PATH_ELEMENT

auto TEST_DIR_PATH_ELEMENT {"test_common bitcoin"}
inlineconstexpr

Definition at line 79 of file setup_common.cpp.