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.
This commit is contained in:
MarcoFalke 2024-08-07 20:37:34 +02:00
parent fae7e3791c
commit fa2cb654ec
No known key found for this signature in database

View file

@ -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();