MCPcopy Create free account
hub / github.com/ElementsProject/elements / Seed

Function Seed

src/test/util/setup_common.cpp:74–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void Seed(FastRandomContext& ctx)
75{
76 // Should be enough to get the seed once for the process
77 static uint256 seed{};
78 static const std::string RANDOM_CTX_SEED{"RANDOM_CTX_SEED"};
79 if (seed.IsNull()) seed = GetUintFromEnv(RANDOM_CTX_SEED);
80 if (seed.IsNull()) seed = GetRandHash();
81 LogPrintf("%s: Setting random seed for current tests to %s=%s\n", __func__, RANDOM_CTX_SEED, seed.GetHex());
82 ctx = FastRandomContext(seed);
83}
84
85std::ostream& operator<<(std::ostream& os, const uint256& num)
86{

Callers 1

SeedInsecureRandFunction · 0.85

Calls 5

GetUintFromEnvFunction · 0.85
GetRandHashFunction · 0.85
FastRandomContextClass · 0.85
IsNullMethod · 0.45
GetHexMethod · 0.45

Tested by

no test coverage detected