Create InsecureRandMoneyAmount() test util helper

to generate semi-random CAmounts up to MAX_MONEY rather
than only uint32, and use it in the unit tests.
This commit is contained in:
Jon Atack
2023-01-20 11:05:09 -08:00
parent 81f5ade2a3
commit 9d92c3d7f4
6 changed files with 10 additions and 5 deletions

View File

@@ -173,7 +173,7 @@ void SimulationTest(CCoinsView* base, bool fake_best_block)
if (InsecureRandRange(5) == 0 || coin.IsSpent()) {
Coin newcoin;
newcoin.out.nValue = InsecureRand32();
newcoin.out.nValue = InsecureRandMoneyAmount();
newcoin.nHeight = 1;
// Infrequently test adding unspendable coins.