35 setup.m_node.chainman.reset();
36 setup.m_make_chainman();
37 setup.LoadVerifyActivateChainstate();
43 setup.m_node.validation_signals->SyncWithValidationInterfaceQueue();
49 static const auto testing_setup{
70 chainman.DisableNextWrite();
76 node.addrman = std::make_unique<AddrMan>(*
node.netgroupman,
true, 0);
81 .reconcile_txs = true,
82 .deterministic_rng = true,
84 connman.SetMsgProc(
node.peerman.get());
85 connman.SetAddrman(*
node.addrman);
89 std::vector<CNode*> peers;
122 }
catch (
const std::ios_base::failure&) {
127 node.validation_signals->SyncWithValidationInterfaceQueue();
128 node.connman->StopNodes();
const TestingSetup * g_setup
Information about a peer.
std::string ConsumeBytesAsString(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
static Mutex g_msgproc_mutex
Mutex for anything that is only accessed via the msg processing thread.
static std::unique_ptr< PeerManager > make(CConnman &connman, AddrMan &addrman, BanMan *banman, ChainstateManager &chainman, CTxMemPool &pool, node::Warnings &warnings, Options opts)
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable).
void initialize_process_messages()
void Reset()
Reset the internal state.
Testing setup that configures a complete environment.
bool include_dummy_extranonce
Whether to include an OP_0 as a dummy extraNonce in the template's coinbase.
#define WITH_LOCK(cs, code)
Run code while locking a mutex.
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
COutPoint MineBlock(const NodeContext &node, const node::BlockAssembler::Options &assembler_options)
Returns the generated coin.
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
FuzzedDataProvider & fuzzed_data_provider