Bitcoin ABC  0.24.7
P2P Digital Currency
wallet_test_fixture.h
Go to the documentation of this file.
1 // Copyright (c) 2016 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 <interfaces/chain.h>
9 #include <interfaces/wallet.h>
10 #include <node/context.h>
11 #include <util/check.h>
12 #include <wallet/wallet.h>
13 
14 #include <test/util/setup_common.h>
15 
16 #include <memory>
17 
21 struct WalletTestingSetup : public TestingSetup {
22  explicit WalletTestingSetup(
23  const std::string &chainName = CBaseChainParams::MAIN);
24 
25  std::unique_ptr<interfaces::Chain> m_chain;
26  std::unique_ptr<interfaces::WalletClient> m_wallet_client =
29  std::unique_ptr<interfaces::Handler> m_chain_notifications_handler;
30 };
31 
32 #endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
WalletTestingSetup::m_wallet
CWallet m_wallet
Definition: wallet_test_fixture.h:28
check.h
wallet.h
NodeContext::args
ArgsManager * args
Definition: context.h:44
WalletTestingSetup::m_chain_notifications_handler
std::unique_ptr< interfaces::Handler > m_chain_notifications_handler
Definition: wallet_test_fixture.h:29
chain.h
WalletTestingSetup::WalletTestingSetup
WalletTestingSetup(const std::string &chainName=CBaseChainParams::MAIN)
Definition: wallet_test_fixture.cpp:11
interfaces::MakeWalletClient
std::unique_ptr< WalletClient > MakeWalletClient(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet client.
Definition: wallet.cpp:562
context.h
Assert
#define Assert(val)
Identity function.
Definition: check.h:56
WalletTestingSetup::m_wallet_client
std::unique_ptr< interfaces::WalletClient > m_wallet_client
Definition: wallet_test_fixture.h:26
WalletTestingSetup
Testing setup and teardown for wallet.
Definition: wallet_test_fixture.h:21
CBaseChainParams::MAIN
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:21
m_node
NodeContext & m_node
Definition: chain.cpp:485
WalletTestingSetup::m_chain
std::unique_ptr< interfaces::Chain > m_chain
Definition: wallet_test_fixture.h:25
CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:678
wallet.h