mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-01 01:10:30 +02:00
test: refactor: Pass rng parameters to test functions
Add FastRandomContext parameter to the utility function AddTestCoin(), and a few local test functions and classes.
This commit is contained in:
@@ -13,10 +13,10 @@
|
||||
#include <stdint.h>
|
||||
#include <utility>
|
||||
|
||||
COutPoint AddTestCoin(CCoinsViewCache& coins_view)
|
||||
COutPoint AddTestCoin(FastRandomContext& rng, CCoinsViewCache& coins_view)
|
||||
{
|
||||
Coin new_coin;
|
||||
COutPoint outpoint{Txid::FromUint256(InsecureRand256()), /*nIn=*/0};
|
||||
COutPoint outpoint{Txid::FromUint256(rng.rand256()), /*nIn=*/0};
|
||||
new_coin.nHeight = 1;
|
||||
new_coin.out.nValue = InsecureRandMoneyAmount();
|
||||
new_coin.out.scriptPubKey.assign(uint32_t{56}, 1);
|
||||
|
||||
Reference in New Issue
Block a user