-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2381 from barton2526/FastRandomContext
test, refactor: Use FastRandomContext for all tests. Add a header for test_gridcoin
- Loading branch information
Showing
6 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) 2015-2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#ifndef GRIDCOIN_TEST_TEST_GRIDCOIN_H | ||
#define GRIDCOIN_TEST_TEST_GRIDCOIN_H | ||
|
||
#include <main.h> | ||
#include <random.h> | ||
#include <wallet/wallet.h> | ||
|
||
extern FastRandomContext g_insecure_rand_ctx; | ||
|
||
static inline uint32_t InsecureRand32() { return g_insecure_rand_ctx.rand32(); } | ||
static inline uint256 InsecureRand256() { return g_insecure_rand_ctx.rand256(); } | ||
static inline uint64_t InsecureRandBits(int bits) { return g_insecure_rand_ctx.randbits(bits); } | ||
static inline uint64_t InsecureRandRange(uint64_t range) { return g_insecure_rand_ctx.randrange(range); } | ||
static inline bool InsecureRandBool() { return g_insecure_rand_ctx.randbool(); } | ||
static inline std::vector<unsigned char> InsecureRandBytes(size_t len) { return g_insecure_rand_ctx.randbytes(len); } | ||
|
||
#endif |