36 #include <string_view> 41 std::string_view LIMIT_TO_MESSAGE_TYPE{};
46 if (
const auto val{std::getenv(
"LIMIT_TO_MESSAGE_TYPE")}) {
47 LIMIT_TO_MESSAGE_TYPE = val;
51 static const auto testing_setup = MakeNoLogFileContext<const TestingSetup>(
53 {
"-txreconciliation"});
54 g_setup = testing_setup.get();
73 if (!LIMIT_TO_MESSAGE_TYPE.empty() && random_message_type != LIMIT_TO_MESSAGE_TYPE) {
78 connman.AddTestNode(p2p_node);
79 FillNode(fuzzed_data_provider, connman, p2p_node);
81 const auto mock_time =
ConsumeTime(fuzzed_data_provider);
87 g_setup->m_node.peerman->ProcessMessage(p2p_node, random_message_type, random_bytes_data_stream,
88 GetTime<std::chrono::microseconds>(), std::atomic<bool>{
false});
89 }
catch (
const std::ios_base::failure&) {
91 g_setup->m_node.peerman->SendMessages(&p2p_node);
93 g_setup->m_node.connman->StopNodes();
static Mutex g_msgproc_mutex
Mutex for anything that is only accessed via the msg processing thread.
void FillNode(FuzzedDataProvider &fuzzed_data_provider, ConnmanTestMsg &connman, CNode &node) noexcept
void SyncWithValidationInterfaceQueue()
This is a synonym for the following, which asserts certain locks are not held: std::promise<void> pro...
void initialize_process_message()
std::unique_ptr< CNode > ConsumeNodeAsUniquePtr(FuzzedDataProvider &fdp, const std::optional< NodeId > &node_id_in=std::nullopt)
static const int COINBASE_MATURITY
Coinbase transaction outputs can only be spent after this number of new blocks (network rule) ...
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
FUZZ_TARGET(process_message,.init=initialize_process_message)
const std::vector< std::string > & getAllNetMessageTypes()
COutPoint MineBlock(const NodeContext &node, const CScript &coinbase_scriptPubKey)
Returns the generated coin.
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.
static const int PROTOCOL_VERSION
network protocol versioning
Information about a peer.
Testing setup that configures a complete environment.
#define Assert(val)
Identity function.