5 #include <chainparams.h> 27 static const auto testing_setup = MakeNoLogFileContext<>(
ChainType::MAIN);
35 node.SetCommonVersion(fuzzed_data_provider.ConsumeIntegral<
int>());
40 node.CloseSocketDisconnect();
44 node.CopyStats(stats);
47 const CNode* add_ref_node =
node.AddRef();
51 if (
node.GetRefCount() > 0) {
56 const std::optional<CService> service_opt = ConsumeDeserializable<CService>(fuzzed_data_provider, ConsumeDeserializationParams<CNetAddr::SerParams>(fuzzed_data_provider));
60 node.SetAddrLocal(*service_opt);
65 node.ReceiveMsgBytes(b, complete);
69 (void)
node.GetAddrLocal();
71 (void)
node.GetLocalNonce();
72 const int ref_count =
node.GetRefCount();
74 (void)
node.GetCommonVersion();
77 (void)
node.HasPermission(net_permission_flags);
78 (void)
node.ConnectedThroughNetwork();
WeakEnumType ConsumeWeakEnum(FuzzedDataProvider &fuzzed_data_provider, const WeakEnumType(&all_types)[size]) noexcept
constexpr NetPermissionFlags ALL_NET_PERMISSION_FLAGS[]
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
auto ConsumeNode(FuzzedDataProvider &fuzzed_data_provider, const std::optional< NodeId > &node_id_in=std::nullopt) noexcept
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
void SetMockTime(int64_t nMockTimeIn)
DEPRECATED Use SetMockTime with chrono type.
FUZZ_TARGET(net,.init=initialize_net)
int64_t ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
Information about a peer.