mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Make unit tests use the insecure_rand_ctx exclusively
This commit is contained in:
parent
8d98d42611
commit
fd3e7973ff
3 changed files with 15 additions and 32 deletions
|
|
@ -104,8 +104,8 @@ void BuildChain(const uint256& root, int height, const unsigned int invalid_rate
|
|||
{
|
||||
if (height <= 0 || blocks.size() >= max_size) return;
|
||||
|
||||
bool gen_invalid = GetRand(100) < invalid_rate;
|
||||
bool gen_fork = GetRand(100) < branch_rate;
|
||||
bool gen_invalid = InsecureRandRange(100) < invalid_rate;
|
||||
bool gen_fork = InsecureRandRange(100) < branch_rate;
|
||||
|
||||
const std::shared_ptr<const CBlock> pblock = gen_invalid ? BadBlock(root) : GoodBlock(root);
|
||||
blocks.push_back(pblock);
|
||||
|
|
@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(processnewblock_signals_ordering)
|
|||
threads.create_thread([&blocks]() {
|
||||
bool ignored;
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
auto block = blocks[GetRand(blocks.size() - 1)];
|
||||
auto block = blocks[InsecureRandRange(blocks.size() - 1)];
|
||||
ProcessNewBlock(Params(), block, true, &ignored);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue