MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TestLoadWallet

Function TestLoadWallet

src/wallet/test/wallet_tests.cpp:330–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void TestLoadWallet(const std::string& name, DatabaseFormat format, std::function<void(std::shared_ptr<CWallet>)> f)
331{
332 node::NodeContext node;
333 auto chain{interfaces::MakeChain(node)};
334 DatabaseOptions options;
335 options.require_format = format;
336 DatabaseStatus status;
337 bilingual_str error;
338 std::vector<bilingual_str> warnings;
339 auto database{MakeWalletDatabase(name, options, status, error)};
340 auto wallet{std::make_shared<CWallet>(chain.get(), "", std::move(database))};
341 BOOST_CHECK_EQUAL(wallet->PopulateWalletFromDB(error, warnings), DBErrors::LOAD_OK);
342 WITH_LOCK(wallet->cs_wallet, f(wallet));
343}
344
345BOOST_FIXTURE_TEST_CASE(LoadReceiveRequests, TestingSetup)
346{

Callers 1

BOOST_FIXTURE_TEST_CASEFunction · 0.70

Calls 4

MakeChainFunction · 0.85
MakeWalletDatabaseFunction · 0.85
PopulateWalletFromDBMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected