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

@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(validation_chainstate_resize_caches)
uint256 txid = InsecureRand256();
COutPoint outp{txid, 0};
newcoin.nHeight = 1;
newcoin.out.nValue = InsecureRand32();
newcoin.out.nValue = InsecureRandMoneyAmount();
newcoin.out.scriptPubKey.assign(uint32_t{56}, 1);
coins_view.AddCoin(outp, std::move(newcoin), false);