Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.h
// Copyright (c) 2015-2016 The Bitcoin Core developers | // Copyright (c) 2015-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_TEST_TEST_BITCOIN_H | #ifndef BITCOIN_TEST_TEST_BITCOIN_H | ||||
#define BITCOIN_TEST_TEST_BITCOIN_H | #define BITCOIN_TEST_TEST_BITCOIN_H | ||||
#include "chainparamsbase.h" | #include "chainparamsbase.h" | ||||
#include "fs.h" | |||||
#include "key.h" | #include "key.h" | ||||
#include "pubkey.h" | #include "pubkey.h" | ||||
#include "random.h" | #include "random.h" | ||||
#include "txdb.h" | #include "txdb.h" | ||||
#include "txmempool.h" | #include "txmempool.h" | ||||
#include <boost/filesystem.hpp> | |||||
#include <boost/thread.hpp> | #include <boost/thread.hpp> | ||||
extern uint256 insecure_rand_seed; | extern uint256 insecure_rand_seed; | ||||
extern FastRandomContext insecure_rand_ctx; | extern FastRandomContext insecure_rand_ctx; | ||||
static inline void SeedInsecureRand(bool fDeterministic = false) { | static inline void SeedInsecureRand(bool fDeterministic = false) { | ||||
if (fDeterministic) { | if (fDeterministic) { | ||||
insecure_rand_seed = uint256(); | insecure_rand_seed = uint256(); | ||||
Show All 34 Lines | |||||
}; | }; | ||||
/** Testing setup that configures a complete environment. | /** Testing setup that configures a complete environment. | ||||
* Included are data directory, coins database, script check threads setup. | * Included are data directory, coins database, script check threads setup. | ||||
*/ | */ | ||||
class CConnman; | class CConnman; | ||||
struct TestingSetup : public BasicTestingSetup { | struct TestingSetup : public BasicTestingSetup { | ||||
CCoinsViewDB *pcoinsdbview; | CCoinsViewDB *pcoinsdbview; | ||||
boost::filesystem::path pathTemp; | fs::path pathTemp; | ||||
boost::thread_group threadGroup; | boost::thread_group threadGroup; | ||||
CConnman *connman; | CConnman *connman; | ||||
TestingSetup(const std::string &chainName = CBaseChainParams::MAIN); | TestingSetup(const std::string &chainName = CBaseChainParams::MAIN); | ||||
~TestingSetup(); | ~TestingSetup(); | ||||
}; | }; | ||||
class CBlock; | class CBlock; | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |