26 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
27 g_setup = testing_setup.get();
43 std::vector<CNode*> peers;
44 const auto num_peers_to_add = fuzzed_data_provider.ConsumeIntegralInRange(1, 3);
45 for (
int i = 0; i < num_peers_to_add; ++i) {
47 CNode& p2p_node = *peers.back();
49 FillNode(fuzzed_data_provider, connman, p2p_node);
51 connman.AddTestNode(p2p_node);
57 const auto mock_time =
ConsumeTime(fuzzed_data_provider);
61 net_msg.
m_type = random_message_type;
66 (void)connman.ReceiveMsgFrom(random_node, net_msg);
70 connman.ProcessMessagesOnce(random_node);
71 }
catch (
const std::ios_base::failure&) {
75 g_setup->m_node.peerman->SendMessages(&random_node);
79 g_setup->m_node.connman->StopNodes();
std::atomic_bool fPauseSend
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
FUZZ_TARGET_INIT(process_messages, initialize_process_messages)
CTxIn MineBlock(const NodeContext &node, const CScript &coinbase_scriptPubKey)
Returns the generated coin.
std::vector< unsigned char > data
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.
void initialize_process_messages()
RecursiveMutex cs_sendProcessing
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
void ResetIbd()
Reset the ibd cache to its initial state.
std::vector< uint8_t > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
Serialized script, used inside transaction inputs and outputs.
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
Information about a peer.
Testing setup that configures a complete environment.
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)