Bitcoin Core
32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
wallet
test
wallet_test_fixture.cpp
Go to the documentation of this file.
1
// Copyright (c) 2016-present 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_chain_notifications_handler
=
m_node
.
chain
->handleNotifications({ &
m_wallet
, [](
CWallet
*) {} });
18
m_wallet_loader
->registerRpcs();
19
}
20
21
WalletTestingSetup::~WalletTestingSetup
()
22
{
23
if
(
m_node
.
scheduler
)
m_node
.
scheduler
->stop();
24
}
25
}
// namespace wallet
m_node
node::NodeContext m_node
Definition
bitcoin-gui.cpp:48
args
ArgsManager & args
Definition
bitcoind.cpp:280
chaintype.h
ChainType
ChainType
Definition
chaintype.h:12
Assert
#define Assert(val)
Identity function.
Definition
check.h:119
wallet::CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition
wallet.h:318
interfaces
Definition
interfaces.cpp:42
wallet
Definition
coin_selection.cpp:31
wallet::CreateMockableWalletDatabase
std::unique_ptr< WalletDatabase > CreateMockableWalletDatabase()
Definition
util.cpp:126
scheduler.h
BasicTestingSetup::m_node
node::NodeContext m_node
Definition
setup_common.h:60
TestingSetup
Testing setup that configures a complete environment.
Definition
setup_common.h:119
node::NodeContext::scheduler
std::unique_ptr< CScheduler > scheduler
Definition
context.h:82
node::NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition
context.h:78
wallet::WalletTestingSetup::m_wallet_loader
std::unique_ptr< interfaces::WalletLoader > m_wallet_loader
Definition
wallet_test_fixture.h:26
wallet::WalletTestingSetup::~WalletTestingSetup
~WalletTestingSetup()
Definition
wallet_test_fixture.cpp:21
wallet::WalletTestingSetup::m_chain_notifications_handler
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition
wallet_test_fixture.h:28
wallet::WalletTestingSetup::m_wallet
CWallet m_wallet
Definition
wallet_test_fixture.h:27
wallet::WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(ChainType chainType=ChainType::MAIN)
Definition
wallet_test_fixture.cpp:12
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:82
m_wallet
std::shared_ptr< CWallet > m_wallet
Definition
interfaces.cpp:544
util.h
wallet_test_fixture.h
Generated on Thu Oct 22 2026 20:00:36 for Bitcoin Core by
1.9.8