Changeset View
Changeset View
Standalone View
Standalone View
src/test/test_bitcoin.cpp
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
TestingSetup::TestingSetup(const std::string &chainName) | TestingSetup::TestingSetup(const std::string &chainName) | ||||
: BasicTestingSetup(chainName) { | : BasicTestingSetup(chainName) { | ||||
// Ideally we'd move all the RPC tests to the functional testing framework | // Ideally we'd move all the RPC tests to the functional testing framework | ||||
// instead of unit tests, but for now we need these here. | // instead of unit tests, but for now we need these here. | ||||
const Config &config = GetConfig(); | const Config &config = GetConfig(); | ||||
RegisterAllRPCCommands(tableRPC); | RPCServer rpcServer; | ||||
RegisterAllRPCCommands(config, rpcServer, tableRPC); | |||||
ClearDatadirCache(); | ClearDatadirCache(); | ||||
pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", | pathTemp = GetTempPath() / strprintf("test_bitcoin_%lu_%i", | ||||
(unsigned long)GetTime(), | (unsigned long)GetTime(), | ||||
(int)(InsecureRandRange(100000))); | (int)(InsecureRandRange(100000))); | ||||
fs::create_directories(pathTemp); | fs::create_directories(pathTemp); | ||||
gArgs.ForceSetArg("-datadir", pathTemp.string()); | gArgs.ForceSetArg("-datadir", pathTemp.string()); | ||||
mempool.setSanityCheck(1.0); | mempool.setSanityCheck(1.0); | ||||
pblocktree = new CBlockTreeDB(1 << 20, true); | pblocktree = new CBlockTreeDB(1 << 20, true); | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |