From 232aa9e034d4d48f4d16dfdc6bc0d56c9274cfd3 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 31 Mar 2014 12:39:32 -0300 Subject: [PATCH] Add code generating data/sighash.json test data --- src/test/sighash_tests.cpp | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp index 0cc9bc20b9..9985ad6928 100644 --- a/src/test/sighash_tests.cpp +++ b/src/test/sighash_tests.cpp @@ -114,11 +114,21 @@ void static RandomTransaction(CTransaction &tx, bool fSingle) { } BOOST_AUTO_TEST_SUITE(sighash_tests) + BOOST_AUTO_TEST_CASE(sighash_test) { seed_insecure_rand(false); + + #if defined(PRINT_SIGHASH_JSON) + std::cout << "[\n"; + std::cout << "\t[\"raw_transaction, script, input_index, hashType, signature_hash (result)\"],\n"; + #endif + int nRandomTests = 50000; - for (int i=0; i<50000; i++) { + #if defined(PRINT_SIGHASH_JSON) + nRandomTests = 500; + #endif + for (int i=0; i