Bitcoin ABC 0.34.3
P2P Digital Currency
Loading...
Searching...
No Matches
wallet_test_fixture.cpp
Go to the documentation of this file.
1// Copyright (c) 2016 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#include <chainparams.h>
8#include <scheduler.h>
9#include <util/chaintype.h>
10#include <validationinterface.h>
11#include <wallet/rpc/backup.h>
12
14 : TestingSetup(chainType), m_wallet_client{interfaces::MakeWalletClient(
15 *m_node.chain, *Assert(m_node.args))},
16 m_wallet(m_node.chain.get(), "", CreateMockWalletDatabase()) {
19 m_node.chain->handleNotifications({&m_wallet, [](CWallet *) {}});
20 m_wallet_client->registerRpcs();
21}
22
24 if (m_node.scheduler) {
25 m_node.scheduler->stop();
26 }
27}
ChainType
Definition chaintype.h:11
#define Assert(val)
Identity function.
Definition check.h:87
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition wallet.h:270
DBErrors LoadWallet()
Definition wallet.cpp:2265
NodeContext & m_node
WalletTestingSetup(const ChainType chainType=ChainType::MAIN)
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
std::unique_ptr< interfaces::WalletClient > m_wallet_client
std::shared_ptr< CWallet > m_wallet
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.