From fa2cb654eca8dd6ed89101cd6d199ba1de0b81e0 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Wed, 7 Aug 2024 20:37:34 +0200 Subject: [PATCH] test: Add m_rng alias for the global random context The two names point to the same object, but having the reference now allows easier removal of the global in the future. --- src/test/util/setup_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h index b73acc1de5..5b8db6ed76 100644 --- a/src/test/util/setup_common.h +++ b/src/test/util/setup_common.h @@ -13,6 +13,7 @@ #include #include #include +#include #include // IWYU pragma: export #include #include @@ -64,6 +65,7 @@ struct TestOpts { struct BasicTestingSetup { util::SignalInterrupt m_interrupt; node::NodeContext m_node; // keep as first member to be destructed last + FastRandomContext& m_rng{g_insecure_rand_ctx}; // Alias (reference) for the global, to allow easy removal of the global in the future. explicit BasicTestingSetup(const ChainType chainType = ChainType::MAIN, TestOpts = {}); ~BasicTestingSetup();