diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-11-28 19:11:52 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2023-11-28 19:11:52 +0000 |
commit | fd4c6a10f2285f16c5d0215eb56a3060441f3ef2 (patch) | |
tree | 939a409705591dec3bc3f22c94eedad363721295 /src/test/util/setup_common.cpp | |
parent | 31ce305d46a191621aaa78a73fa4bbc7e58d8ed0 (diff) |
test: Setup networking globally
Diffstat (limited to 'src/test/util/setup_common.cpp')
-rw-r--r-- | src/test/util/setup_common.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 22fdf132c7..fcfb33f5e7 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -49,6 +49,7 @@ #include <txdb.h> #include <txmempool.h> #include <util/chaintype.h> +#include <util/check.h> #include <util/rbf.h> #include <util/strencodings.h> #include <util/string.h> @@ -88,6 +89,15 @@ std::ostream& operator<<(std::ostream& os, const uint256& num) return os; } +struct NetworkSetup +{ + NetworkSetup() + { + Assert(SetupNetworking()); + } +}; +static NetworkSetup g_networksetup_instance; + BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vector<const char*>& extra_args) : m_path_root{fs::temp_directory_path() / "test_common_" PACKAGE_NAME / g_insecure_rand_ctx_temp_path.rand256().ToString()}, m_args{} @@ -130,7 +140,6 @@ BasicTestingSetup::BasicTestingSetup(const ChainType chainType, const std::vecto LogInstance().StartLogging(); m_node.kernel = std::make_unique<kernel::Context>(); SetupEnvironment(); - SetupNetworking(); ValidationCacheSizes validation_cache_sizes{}; ApplyArgsManOptions(*m_node.args, validation_cache_sizes); |