diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-08-07 20:37:34 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2024-08-21 23:27:14 +0200 |
commit | fa2cb654eca8dd6ed89101cd6d199ba1de0b81e0 (patch) | |
tree | f44f1edb10de695f90668541aecd6b9cbf7d1e33 /src/test | |
parent | fae7e3791c9ed8053166773fcfb583ad19d006dd (diff) |
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.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/util/setup_common.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 <primitives/transaction.h> #include <pubkey.h> #include <stdexcept> +#include <test/util/random.h> #include <util/chaintype.h> // IWYU pragma: export #include <util/check.h> #include <util/fs.h> @@ -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(); |