Skip to content

Commit 1119927

Browse files
committed
Add various insecure_rand wrappers for tests
1 parent 124d13a commit 1119927

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/test/test_bitcoin.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ static inline void seed_insecure_rand(bool fDeterministic = false)
2828
insecure_rand_ctx = FastRandomContext(insecure_rand_seed);
2929
}
3030

31-
static inline uint32_t insecure_rand(void)
32-
{
33-
return insecure_rand_ctx.rand32();
34-
}
31+
static inline uint32_t insecure_rand() { return insecure_rand_ctx.rand32(); }
32+
static inline uint256 insecure_rand256() { return insecure_rand_ctx.rand256(); }
33+
static inline uint64_t insecure_randbits(int bits) { return insecure_rand_ctx.randbits(bits); }
34+
static inline uint64_t insecure_randrange(uint64_t range) { return insecure_rand_ctx.randrange(range); }
35+
static inline bool insecure_randbool() { return insecure_rand_ctx.randbool(); }
36+
static inline std::vector<unsigned char> insecure_randbytes(size_t len) { return insecure_rand_ctx.randbytes(len); }
3537

3638
/** Basic testing setup.
3739
* This just configures logging and chain parameters.

0 commit comments

Comments
 (0)