move rand functions from util to new random.h/.cpp
This commit is contained in:
@@ -6,12 +6,11 @@
|
||||
// Unit tests for canonical signatures
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include "script.h"
|
||||
#include "util.h"
|
||||
#include "data/sig_noncanonical.json.h"
|
||||
#include "data/sig_canonical.json.h"
|
||||
#include "random.h"
|
||||
#include "script.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
@@ -21,7 +20,6 @@
|
||||
using namespace std;
|
||||
using namespace json_spirit;
|
||||
|
||||
|
||||
// In script_tests.cpp
|
||||
extern Array read_json(const std::string& jsondata);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "crypto/ripemd160.h"
|
||||
#include "crypto/sha1.h"
|
||||
#include "crypto/sha2.h"
|
||||
#include "random.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "mruset.h"
|
||||
|
||||
#include "random.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include "data/sighash.json.h"
|
||||
#include "main.h"
|
||||
#include "random.h"
|
||||
#include "serialize.h"
|
||||
#include "util.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "main.h"
|
||||
#include "util.h"
|
||||
#include "serialize.h"
|
||||
#include "version.h"
|
||||
#include "data/sighash.json.h"
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include "json/json_spirit_reader_template.h"
|
||||
#include "json/json_spirit_utils.h"
|
||||
#include "json/json_spirit_writer_template.h"
|
||||
@@ -118,7 +119,7 @@ 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";
|
||||
@@ -205,10 +206,9 @@ BOOST_AUTO_TEST_CASE(sighash_from_data)
|
||||
BOOST_ERROR("Bad test, couldn't deserialize data: " << strTest);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
sh = SignatureHash(scriptCode, tx, nIn, nHashType);
|
||||
BOOST_CHECK_MESSAGE(sh.GetHex() == sigHashHex, strTest);
|
||||
}
|
||||
}
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <vector>
|
||||
#include "main.h"
|
||||
#include "random.h"
|
||||
#include "util.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#define SKIPLIST_LENGTH 300000
|
||||
|
||||
@@ -98,4 +100,3 @@ BOOST_AUTO_TEST_CASE(getlocator_test)
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
|
||||
#define BOOST_TEST_MODULE Bitcoin Test Suite
|
||||
|
||||
|
||||
|
||||
#include "main.h"
|
||||
#include "random.h"
|
||||
#include "txdb.h"
|
||||
#include "ui_interface.h"
|
||||
#include "util.h"
|
||||
@@ -89,4 +88,3 @@ bool ShutdownRequested()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "random.h"
|
||||
#include "sync.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
Reference in New Issue
Block a user