5#ifndef BITCOIN_TEST_UTIL_VALIDATION_H
6#define BITCOIN_TEST_UTIL_VALIDATION_H
32 size_t size()
override {
return 0; }
60 const std::shared_ptr<const CBlock>& block,
The block chain is a tree shaped structure starting with the genesis block at the root,...
Implement this to subscribe to events generated in validation and mempool.
Interface for managing multiple Chainstate objects, where each chainstate is associated with chainsta...
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
static void BlockConnected(const kernel::ChainstateRole &role, CValidationInterface &obj, const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex)
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
std::thread thread
Thread variable should be after other struct members so the thread does not start until the other mem...
void CleanupForFuzzing()
Test-only method to clear internal state for fuzzing.
void ResetBestInvalid() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
void InvalidChainFound(CBlockIndex *pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
CBlockIndex * FindMostWorkChain() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
void DisableNextWrite()
Disable the next write of all chainstates.
void InvalidBlockFound(CBlockIndex *pindex, const BlockValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Wrappers that avoid making chainstatemanager internals public for tests.
void JumpOutOfIbd()
Toggle IsInitialBlockDownload from true to false.
void ResetIbd()
Reset the ibd cache to its initial state.
Testing setup that configures a complete environment.
Information about chainstate that notifications are sent from.
This header provides an interface and simple implementation for a task runner.
std::vector< std::pair< COutPoint, CAmount > > ResetChainmanAndMempool(TestingSetup &setup, FakeNodeClock &node_clock)
#define EXCLUSIVE_LOCKS_REQUIRED(...)