@@ -220,17 +220,23 @@ ChainTestingSetup::~ChainTestingSetup()
220
220
m_node.chainman .reset ();
221
221
}
222
222
223
- TestingSetup::TestingSetup (const std::string& chainName, const std::vector<const char *>& extra_args)
224
- : ChainTestingSetup(chainName, extra_args)
223
+ TestingSetup::TestingSetup (
224
+ const std::string& chainName,
225
+ const std::vector<const char *>& extra_args,
226
+ const bool coins_db_in_memory,
227
+ const bool block_tree_db_in_memory)
228
+ : ChainTestingSetup(chainName, extra_args),
229
+ m_coins_db_in_memory(coins_db_in_memory),
230
+ m_block_tree_db_in_memory(block_tree_db_in_memory)
225
231
{
226
232
// Ideally we'd move all the RPC tests to the functional testing framework
227
233
// instead of unit tests, but for now we need these here.
228
234
RegisterAllCoreRPCCommands (tableRPC);
229
235
230
236
node::ChainstateLoadOptions options;
231
237
options.mempool = Assert (m_node.mempool .get ());
232
- options.block_tree_db_in_memory = true ;
233
- options.coins_db_in_memory = true ;
238
+ options.block_tree_db_in_memory = m_block_tree_db_in_memory ;
239
+ options.coins_db_in_memory = m_coins_db_in_memory ;
234
240
options.reindex = node::fReindex ;
235
241
options.reindex_chainstate = m_args.GetBoolArg (" -reindex-chainstate" , false );
236
242
options.prune = node::fPruneMode ;
@@ -263,8 +269,12 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
263
269
}
264
270
}
265
271
266
- TestChain100Setup::TestChain100Setup (const std::string& chain_name, const std::vector<const char *>& extra_args)
267
- : TestingSetup{chain_name, extra_args}
272
+ TestChain100Setup::TestChain100Setup (
273
+ const std::string& chain_name,
274
+ const std::vector<const char *>& extra_args,
275
+ const bool coins_db_in_memory,
276
+ const bool block_tree_db_in_memory)
277
+ : TestingSetup{CBaseChainParams::REGTEST, extra_args, coins_db_in_memory, block_tree_db_in_memory}
268
278
{
269
279
SetMockTime (1598887952 );
270
280
constexpr std::array<unsigned char , 32 > vchKey = {
0 commit comments