Skip to content

Commit fa2cb65

Browse files
author
MarcoFalke
committed
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.
1 parent fae7e37 commit fa2cb65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/test/util/setup_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <primitives/transaction.h>
1414
#include <pubkey.h>
1515
#include <stdexcept>
16+
#include <test/util/random.h>
1617
#include <util/chaintype.h> // IWYU pragma: export
1718
#include <util/check.h>
1819
#include <util/fs.h>
@@ -64,6 +65,7 @@ struct TestOpts {
6465
struct BasicTestingSetup {
6566
util::SignalInterrupt m_interrupt;
6667
node::NodeContext m_node; // keep as first member to be destructed last
68+
FastRandomContext& m_rng{g_insecure_rand_ctx}; // Alias (reference) for the global, to allow easy removal of the global in the future.
6769

6870
explicit BasicTestingSetup(const ChainType chainType = ChainType::MAIN, TestOpts = {});
6971
~BasicTestingSetup();

0 commit comments

Comments
 (0)