mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +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:
@@ -30,16 +30,16 @@ static CBlock BuildBlockTestCase() {
|
||||
block.vtx.resize(3);
|
||||
block.vtx[0] = MakeTransactionRef(tx);
|
||||
block.nVersion = 42;
|
||||
block.hashPrevBlock = GetRandHash();
|
||||
block.hashPrevBlock = insecure_rand256();
|
||||
block.nBits = 0x207fffff;
|
||||
|
||||
tx.vin[0].prevout.hash = GetRandHash();
|
||||
tx.vin[0].prevout.hash = insecure_rand256();
|
||||
tx.vin[0].prevout.n = 0;
|
||||
block.vtx[1] = MakeTransactionRef(tx);
|
||||
|
||||
tx.vin.resize(10);
|
||||
for (size_t i = 0; i < tx.vin.size(); i++) {
|
||||
tx.vin[i].prevout.hash = GetRandHash();
|
||||
tx.vin[i].prevout.hash = insecure_rand256();
|
||||
tx.vin[i].prevout.n = 0;
|
||||
}
|
||||
block.vtx[2] = MakeTransactionRef(tx);
|
||||
@@ -283,7 +283,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||
block.vtx.resize(1);
|
||||
block.vtx[0] = MakeTransactionRef(std::move(coinbase));
|
||||
block.nVersion = 42;
|
||||
block.hashPrevBlock = GetRandHash();
|
||||
block.hashPrevBlock = insecure_rand256();
|
||||
block.nBits = 0x207fffff;
|
||||
|
||||
bool mutated;
|
||||
@@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TransactionsRequestSerializationTest) {
|
||||
BlockTransactionsRequest req1;
|
||||
req1.blockhash = GetRandHash();
|
||||
req1.blockhash = insecure_rand256();
|
||||
req1.indexes.resize(4);
|
||||
req1.indexes[0] = 0;
|
||||
req1.indexes[1] = 1;
|
||||
|
||||
Reference in New Issue
Block a user