Bitcoin Core  0.20.99
P2P Digital Currency
wallet_test_fixture.cpp
Go to the documentation of this file.
1 // Copyright (c) 2016-2020 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
6 
7 WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
8  : TestingSetup(chainName),
9  m_wallet(m_chain.get(), "", CreateMockWalletDatabase())
10 {
11  bool fFirstRun;
12  m_wallet.LoadWallet(fFirstRun);
13  m_chain_notifications_handler = m_chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
14  m_wallet_client->registerRpcs();
15 }
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
Definition: walletdb.cpp:1042
std::shared_ptr< CWallet > m_wallet
Definition: wallet.cpp:485
std::unique_ptr< interfaces::Chain > m_chain
DBErrors LoadWallet(bool &fFirstRunRet)
Definition: wallet.cpp:3186
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:622
std::unique_ptr< interfaces::WalletClient > m_wallet_client
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
WalletTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)