Bitcoin Core
28.1.0
P2P Digital Currency
src
wallet
test
wallet_test_fixture.cpp
Go to the documentation of this file.
1
// Copyright (c) 2016-2022 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/util.h
>
6
#include <
wallet/test/wallet_test_fixture.h
>
7
8
#include <
scheduler.h
>
9
#include <
util/chaintype.h
>
10
11
namespace
wallet
{
12
WalletTestingSetup::WalletTestingSetup
(
const
ChainType
chainType)
13
:
TestingSetup
(chainType),
14
m_wallet_loader{
interfaces::MakeWalletLoader
(*
m_node
.
chain
, *
Assert
(
m_node
.
args
))},
15
m_wallet
(
m_node
.
chain
.get(),
""
,
CreateMockableWalletDatabase
())
16
{
17
m_wallet
.LoadWallet();
18
m_chain_notifications_handler =
m_node
.
chain
->handleNotifications({ &
m_wallet
, [](
CWallet
*) {} });
19
m_wallet_loader->registerRpcs();
20
}
21
22
WalletTestingSetup::~WalletTestingSetup
()
23
{
24
if
(
m_node
.
scheduler
)
m_node
.
scheduler
->stop();
25
}
26
}
// namespace wallet
wallet::WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(const ChainType chainType=ChainType::MAIN)
Definition:
wallet_test_fixture.cpp:12
node::NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition:
context.h:73
m_node
node::NodeContext m_node
Definition:
bitcoin-gui.cpp:37
wallet::WalletTestingSetup::~WalletTestingSetup
~WalletTestingSetup()
Definition:
wallet_test_fixture.cpp:22
m_wallet
std::shared_ptr< CWallet > m_wallet
Definition:
interfaces.cpp:564
node::NodeContext::scheduler
std::unique_ptr< CScheduler > scheduler
Definition:
context.h:80
util.h
scheduler.h
interfaces::MakeWalletLoader
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
Definition:
dummywallet.cpp:64
ChainType
ChainType
Definition:
chaintype.h:11
node::NodeContext::args
ArgsManager * args
Definition:
context.h:71
wallet::CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition:
wallet.h:299
wallet
Definition:
wallet_balance.cpp:18
wallet::CreateMockableWalletDatabase
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase(MockableData records)
Definition:
util.cpp:185
wallet_test_fixture.h
chaintype.h
BasicTestingSetup::m_node
node::NodeContext m_node
Definition:
setup_common.h:66
TestingSetup
Testing setup that configures a complete environment.
Definition:
setup_common.h:96
Assert
#define Assert(val)
Identity function.
Definition:
check.h:77
Generated on Tue Jan 7 2025 12:00:00 for Bitcoin Core by
1.8.14