aboutsummaryrefslogtreecommitdiff
path: root/src/test/blockencodings_tests.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-05-23 15:28:45 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2017-06-05 12:45:44 -0700
commitefee1db21a652019e0ab18fffc233d91bb7f1816 (patch)
tree32b2fc3ecb73daa71075df246975fb5e2dae7590 /src/test/blockencodings_tests.cpp
parent1119927df03c94f9306e4d92f55d147b900522fb (diff)
downloadbitcoin-efee1db21a652019e0ab18fffc233d91bb7f1816.tar.xz
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-
Diffstat (limited to 'src/test/blockencodings_tests.cpp')
-rw-r--r--src/test/blockencodings_tests.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/blockencodings_tests.cpp b/src/test/blockencodings_tests.cpp
index 9e4a56919d..3abac85cb1 100644
--- a/src/test/blockencodings_tests.cpp
+++ b/src/test/blockencodings_tests.cpp
@@ -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;