Bitcoin Core  22.99.0
P2P Digital Currency
wallet_test_fixture.h
Go to the documentation of this file.
1 // Copyright (c) 2016-2021 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 
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 
18 namespace wallet {
22  explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
24 
25  std::unique_ptr<interfaces::WalletLoader> m_wallet_loader = interfaces::MakeWalletLoader(*m_node.chain, *Assert(m_node.args));
27  std::unique_ptr<interfaces::Handler> m_chain_notifications_handler;
28 };
29 } // namespace wallet
30 
31 #endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
BasicTestingSetup::m_node
node::NodeContext m_node
Definition: setup_common.h:85
check.h
wallet.h
setup_common.h
wallet
Definition: node.h:38
chain.h
context.h
Assert
#define Assert(val)
Identity function.
Definition: check.h:57
wallet::WalletTestingSetup::~WalletTestingSetup
~WalletTestingSetup()
Definition: wallet_test_fixture.cpp:19
wallet::WalletTestingSetup
Testing setup and teardown for wallet.
Definition: wallet_test_fixture.h:21
wallet::CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:232
wallet::WalletTestingSetup::m_wallet
CWallet m_wallet
Definition: wallet_test_fixture.h:26
CBaseChainParams::MAIN
static const std::string MAIN
Chain name strings.
Definition: chainparamsbase.h:22
node::NodeContext::args
ArgsManager * args
Definition: context.h:50
wallet::WalletTestingSetup::m_chain_notifications_handler
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition: wallet_test_fixture.h:27
wallet::WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
Definition: wallet_test_fixture.cpp:10
TestingSetup
Testing setup that configures a complete environment.
Definition: setup_common.h:107
wallet.h
interfaces::MakeWalletLoader
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
Definition: dummywallet.cpp:61
wallet::WalletTestingSetup::m_wallet_loader
std::unique_ptr< interfaces::WalletLoader > m_wallet_loader
Definition: wallet_test_fixture.h:25
node::NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition: context.h:51