Bitcoin Core
22.0.0
P2P Digital Currency
src
wallet
test
wallet_test_fixture.h
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
#ifndef BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
6
#define BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
7
8
#include <test/util/setup_common.h>
9
10
#include <
interfaces/chain.h
>
11
#include <
interfaces/wallet.h
>
12
#include <
node/context.h
>
13
#include <
util/check.h
>
14
#include <
wallet/wallet.h
>
15
16
#include <memory>
17
20
struct
WalletTestingSetup
:
public
TestingSetup {
21
explicit
WalletTestingSetup
(
const
std::string& chainName =
CBaseChainParams::MAIN
);
22
23
std::unique_ptr<interfaces::WalletClient>
m_wallet_client
=
interfaces::MakeWalletClient
(*
m_node
.
chain
, *
Assert
(
m_node
.
args
));
24
CWallet
m_wallet
;
25
std::unique_ptr<interfaces::Handler>
m_chain_notifications_handler
;
26
};
27
28
#endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
check.h
wallet.h
wallet.h
NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition:
context.h:50
m_node
NodeContext & m_node
Definition:
bitcoin-node.cpp:29
context.h
CBaseChainParams::MAIN
static const std::string MAIN
Chain name strings.
Definition:
chainparamsbase.h:22
WalletTestingSetup::m_wallet
CWallet m_wallet
Definition:
wallet_test_fixture.h:24
chain.h
interfaces::MakeWalletClient
std::unique_ptr< WalletClient > MakeWalletClient(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet client.
Definition:
interfaces.cpp:582
NodeContext::args
ArgsManager * args
Definition:
context.h:49
WalletTestingSetup
Testing setup and teardown for wallet.
Definition:
wallet_test_fixture.h:20
CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition:
wallet.h:226
WalletTestingSetup::m_wallet_client
std::unique_ptr< interfaces::WalletClient > m_wallet_client
Definition:
wallet_test_fixture.h:23
WalletTestingSetup::m_chain_notifications_handler
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition:
wallet_test_fixture.h:25
WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
Definition:
wallet_test_fixture.cpp:7
Assert
#define Assert(val)
Identity function.
Definition:
check.h:57
Generated on Thu Sep 9 2021 12:00:00 for Bitcoin Core by
1.8.14