mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
scripted-diff: use insecure_rand256/randrange more
-BEGIN VERIFY SCRIPT- sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -74,9 +74,9 @@ BOOST_AUTO_TEST_CASE(GetBlockProofEquivalentTime_test)
|
||||
}
|
||||
|
||||
for (int j = 0; j < 1000; j++) {
|
||||
CBlockIndex *p1 = &blocks[GetRand(10000)];
|
||||
CBlockIndex *p2 = &blocks[GetRand(10000)];
|
||||
CBlockIndex *p3 = &blocks[GetRand(10000)];
|
||||
CBlockIndex *p1 = &blocks[insecure_randrange(10000)];
|
||||
CBlockIndex *p2 = &blocks[insecure_randrange(10000)];
|
||||
CBlockIndex *p3 = &blocks[insecure_randrange(10000)];
|
||||
|
||||
int64_t tdiff = GetBlockProofEquivalentTime(*p1, *p2, *p3, chainParams->GetConsensus());
|
||||
BOOST_CHECK_EQUAL(tdiff, p1->GetBlockTime() - p2->GetBlockTime());
|
||||
|
||||
Reference in New Issue
Block a user