26 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>();
27 g_setup = testing_setup.get();
43 std::vector<CNode*> peers;
45 for (
int i = 0; i < num_peers_to_add; ++i) {
47 CNode& p2p_node = *peers.back();
49 const bool successfully_connected{fuzzed_data_provider.
ConsumeBool()};
52 g_setup->m_node.peerman->InitializeNode(&p2p_node);
53 FillNode(fuzzed_data_provider, p2p_node, successfully_connected);
61 const auto mock_time =
ConsumeTime(fuzzed_data_provider);
65 net_msg.
m_type = random_message_type;
75 }
catch (
const std::ios_base::failure&) {
79 g_setup->m_node.peerman->SendMessages(&random_node);
83 g_setup->m_node.connman->StopNodes();
Information about a peer.
RecursiveMutex cs_sendProcessing
std::atomic_bool fSuccessfullyConnected
fSuccessfullyConnected is set to true on receiving VERACK from the peer.
std::atomic_bool fPauseSend
Serialized script, used inside transaction inputs and outputs.
std::string ConsumeBytesAsString(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule)
FUZZ_TARGET_INIT(process_messages, initialize_process_messages)
void initialize_process_messages()
std::vector< unsigned char > data
void ProcessMessagesOnce(CNode &node)
bool ReceiveMsgFrom(CNode &node, CSerializedNetMsg &ser_msg) const
void AddTestNode(CNode &node)
void ResetIbd()
Reset the ibd cache to its initial state.
Testing setup that configures a complete environment.
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
void FillNode(FuzzedDataProvider &fuzzed_data_provider, CNode &node, bool init_version) noexcept
auto & PickValue(FuzzedDataProvider &fuzzed_data_provider, Collection &col)
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
std::vector< uint8_t > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
CTxIn MineBlock(const NodeContext &node, const CScript &coinbase_scriptPubKey)
Returns the generated coin.
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...