Bitcoin Core
22.99.0
P2P Digital Currency
src
wallet
test
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
5
#include <
wallet/test/wallet_test_fixture.h
>
6
7
#include <
scheduler.h
>
8
9
WalletTestingSetup::WalletTestingSetup
(
const
std::string& chainName)
10
:
TestingSetup
(chainName),
11
m_wallet
(
m_node
.chain.get(),
""
,
CreateMockWalletDatabase
())
12
{
13
m_wallet
.
LoadWallet
();
14
m_chain_notifications_handler
=
m_node
.
chain
->handleNotifications({ &
m_wallet
, [](
CWallet
*) {} });
15
m_wallet_client
->registerRpcs();
16
}
17
18
WalletTestingSetup::~WalletTestingSetup
()
19
{
20
if
(
m_node
.
scheduler
)
m_node
.
scheduler
->stop();
21
}
m_node
NodeContext m_node
Definition:
bitcoin-gui.cpp:36
CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition:
wallet.h:229
CWallet::LoadWallet
DBErrors LoadWallet()
Definition:
wallet.cpp:1992
scheduler.h
BasicTestingSetup::m_node
NodeContext m_node
Definition:
setup_common.h:78
NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition:
context.h:50
NodeContext::scheduler
std::unique_ptr< CScheduler > scheduler
Definition:
context.h:56
TestingSetup
Testing setup that configures a complete environment.
Definition:
setup_common.h:99
WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
Definition:
wallet_test_fixture.cpp:9
WalletTestingSetup::m_wallet
CWallet m_wallet
Definition:
wallet_test_fixture.h:25
WalletTestingSetup::~WalletTestingSetup
~WalletTestingSetup()
Definition:
wallet_test_fixture.cpp:18
WalletTestingSetup::m_chain_notifications_handler
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition:
wallet_test_fixture.h:26
WalletTestingSetup::m_wallet_client
std::unique_ptr< interfaces::WalletClient > m_wallet_client
Definition:
wallet_test_fixture.h:24
m_wallet
std::shared_ptr< CWallet > m_wallet
Definition:
interfaces.cpp:502
wallet_test_fixture.h
CreateMockWalletDatabase
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
Definition:
walletdb.cpp:1189
Generated on Mon Nov 8 2021 14:20:08 for Bitcoin Core by
1.9.2