aboutsummaryrefslogtreecommitdiff
path: root/src/test/util/net.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-05-17 11:11:02 +0200
committerJon Atack <jon@atack.com>2021-06-13 20:15:41 +0200
commit4a19f501abac4adb476a6f2a30dfdf1a35892ccc (patch)
tree28b36b569fc3b6dd2a77dc232a7aba184f5a2c48 /src/test/util/net.h
parent519e76bb64d03ecac175ec33c31e37d0e90f037f (diff)
test: add ALL_NETWORKS to test utilities
Diffstat (limited to 'src/test/util/net.h')
-rw-r--r--src/test/util/net.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/util/net.h b/src/test/util/net.h
index 71685d437a..1b49a671bd 100644
--- a/src/test/util/net.h
+++ b/src/test/util/net.h
@@ -6,9 +6,11 @@
#define BITCOIN_TEST_UTIL_NET_H
#include <compat.h>
+#include <netaddress.h>
#include <net.h>
#include <util/sock.h>
+#include <array>
#include <cassert>
#include <cstring>
#include <string>
@@ -67,6 +69,16 @@ constexpr ConnectionType ALL_CONNECTION_TYPES[]{
ConnectionType::ADDR_FETCH,
};
+constexpr auto ALL_NETWORKS = std::array{
+ Network::NET_UNROUTABLE,
+ Network::NET_IPV4,
+ Network::NET_IPV6,
+ Network::NET_ONION,
+ Network::NET_I2P,
+ Network::NET_CJDNS,
+ Network::NET_INTERNAL,
+};
+
/**
* A mocked Sock alternative that returns a statically contained data upon read and succeeds
* and ignores all writes. The data to be returned is given to the constructor and when it is