diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-01-02 10:14:39 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-01-02 15:07:29 +0100 |
commit | eeee43bc48ea7fbacd3c5e3f076f01f04744adb8 (patch) | |
tree | 618c197ac3f3199925d01bb1cf7e56fbe07d8ca0 /src/test/fuzz/util.h | |
parent | fa9949b91414ee0da376a322cee32ba4e3989d8c (diff) | |
download | bitcoin-eeee43bc48ea7fbacd3c5e3f076f01f04744adb8.tar.xz |
fuzz: Use ConsumeWeakEnum for ServiceFlags
Diffstat (limited to 'src/test/fuzz/util.h')
-rw-r--r-- | src/test/fuzz/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/fuzz/util.h b/src/test/fuzz/util.h index 1aa6463b88..94c691936e 100644 --- a/src/test/fuzz/util.h +++ b/src/test/fuzz/util.h @@ -292,14 +292,14 @@ inline CService ConsumeService(FuzzedDataProvider& fuzzed_data_provider) noexcep inline CAddress ConsumeAddress(FuzzedDataProvider& fuzzed_data_provider) noexcept { - return {ConsumeService(fuzzed_data_provider), static_cast<ServiceFlags>(fuzzed_data_provider.ConsumeIntegral<uint64_t>()), fuzzed_data_provider.ConsumeIntegral<uint32_t>()}; + return {ConsumeService(fuzzed_data_provider), ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS), fuzzed_data_provider.ConsumeIntegral<uint32_t>()}; } template <bool ReturnUniquePtr = false> auto ConsumeNode(FuzzedDataProvider& fuzzed_data_provider, const std::optional<NodeId>& node_id_in = nullopt) noexcept { const NodeId node_id = node_id_in.value_or(fuzzed_data_provider.ConsumeIntegral<NodeId>()); - const ServiceFlags local_services = static_cast<ServiceFlags>(fuzzed_data_provider.ConsumeIntegral<uint64_t>()); + const ServiceFlags local_services = ConsumeWeakEnum(fuzzed_data_provider, ALL_SERVICE_FLAGS); const SOCKET socket = INVALID_SOCKET; const CAddress address = ConsumeAddress(fuzzed_data_provider); const uint64_t keyed_net_group = fuzzed_data_provider.ConsumeIntegral<uint64_t>(); |