Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
* This just configures logging and chain parameters. | * This just configures logging and chain parameters. | ||||
*/ | */ | ||||
struct BasicTestingSetup { | struct BasicTestingSetup { | ||||
ECCVerifyHandle globalVerifyHandle; | ECCVerifyHandle globalVerifyHandle; | ||||
explicit BasicTestingSetup( | explicit BasicTestingSetup( | ||||
const std::string &chainName = CBaseChainParams::MAIN); | const std::string &chainName = CBaseChainParams::MAIN); | ||||
~BasicTestingSetup(); | ~BasicTestingSetup(); | ||||
fs::path SetDataDir(const std::string &name); | |||||
private: | |||||
const fs::path m_path_root; | |||||
}; | }; | ||||
/** | /** | ||||
* 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; | ||||
class CNode; | class CNode; | ||||
struct CConnmanTest { | struct CConnmanTest { | ||||
static void AddNode(CNode &node); | static void AddNode(CNode &node); | ||||
static void ClearNodes(); | static void ClearNodes(); | ||||
}; | }; | ||||
class PeerLogicValidation; | class PeerLogicValidation; | ||||
struct TestingSetup : public BasicTestingSetup { | struct TestingSetup : public BasicTestingSetup { | ||||
fs::path pathTemp; | |||||
boost::thread_group threadGroup; | boost::thread_group threadGroup; | ||||
CConnman *connman; | CConnman *connman; | ||||
CScheduler scheduler; | CScheduler scheduler; | ||||
std::unique_ptr<PeerLogicValidation> peerLogic; | std::unique_ptr<PeerLogicValidation> peerLogic; | ||||
explicit TestingSetup( | explicit TestingSetup( | ||||
const std::string &chainName = CBaseChainParams::MAIN); | const std::string &chainName = CBaseChainParams::MAIN); | ||||
~TestingSetup(); | ~TestingSetup(); | ||||
▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines |