diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-05-23 15:00:46 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-06-05 12:44:44 -0700 |
commit | 1119927df03c94f9306e4d92f55d147b900522fb (patch) | |
tree | 2216b4ff708b42cecb6de835d5f8843d4d8e2cde | |
parent | 124d13a58cdcd9f66eeffc7e6281e3eb129e3398 (diff) | |
download | bitcoin-1119927df03c94f9306e4d92f55d147b900522fb.tar.xz |
Add various insecure_rand wrappers for tests
-rw-r--r-- | src/test/test_bitcoin.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h index 80d46e04a6..821ae060b5 100644 --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -28,10 +28,12 @@ static inline void seed_insecure_rand(bool fDeterministic = false) insecure_rand_ctx = FastRandomContext(insecure_rand_seed); } -static inline uint32_t insecure_rand(void) -{ - return insecure_rand_ctx.rand32(); -} +static inline uint32_t insecure_rand() { return insecure_rand_ctx.rand32(); } +static inline uint256 insecure_rand256() { return insecure_rand_ctx.rand256(); } +static inline uint64_t insecure_randbits(int bits) { return insecure_rand_ctx.randbits(bits); } +static inline uint64_t insecure_randrange(uint64_t range) { return insecure_rand_ctx.randrange(range); } +static inline bool insecure_randbool() { return insecure_rand_ctx.randbool(); } +static inline std::vector<unsigned char> insecure_randbytes(size_t len) { return insecure_rand_ctx.randbytes(len); } /** Basic testing setup. * This just configures logging and chain parameters. |