2021-12-30 19:36:57 +02:00
|
|
|
// Copyright (c) 2016-2021 The Bitcoin Core developers
|
2016-04-18 14:54:57 +02:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2018-03-22 15:19:44 +01:00
|
|
|
#ifndef BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
|
|
|
|
#define BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
|
2016-04-18 14:54:57 +02:00
|
|
|
|
2019-11-05 15:18:59 -05:00
|
|
|
#include <test/util/setup_common.h>
|
2016-04-18 14:54:57 +02:00
|
|
|
|
2017-05-30 15:55:17 -04:00
|
|
|
#include <interfaces/chain.h>
|
|
|
|
#include <interfaces/wallet.h>
|
2019-09-17 18:28:03 -04:00
|
|
|
#include <node/context.h>
|
2020-05-11 17:40:21 +02:00
|
|
|
#include <util/check.h>
|
2017-11-18 14:11:34 +01:00
|
|
|
#include <wallet/wallet.h>
|
|
|
|
|
2018-04-02 18:31:40 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2021-11-12 11:13:29 -05:00
|
|
|
namespace wallet {
|
2016-04-18 14:54:57 +02:00
|
|
|
/** Testing setup and teardown for wallet.
|
|
|
|
*/
|
2020-05-11 17:40:21 +02:00
|
|
|
struct WalletTestingSetup : public TestingSetup {
|
2017-08-01 12:22:41 +02:00
|
|
|
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
|
2021-10-31 13:19:03 +02:00
|
|
|
~WalletTestingSetup();
|
2017-11-18 14:11:34 +01:00
|
|
|
|
2021-12-22 13:44:55 -05:00
|
|
|
std::unique_ptr<interfaces::WalletLoader> m_wallet_loader = interfaces::MakeWalletLoader(*m_node.chain, *Assert(m_node.args));
|
2017-11-13 21:25:46 -05:00
|
|
|
CWallet m_wallet;
|
2020-03-10 15:46:20 -04:00
|
|
|
std::unique_ptr<interfaces::Handler> m_chain_notifications_handler;
|
2016-04-18 14:54:57 +02:00
|
|
|
};
|
2021-11-12 11:13:29 -05:00
|
|
|
} // namespace wallet
|
2016-04-18 14:54:57 +02:00
|
|
|
|
2018-03-22 15:19:44 +01:00
|
|
|
#endif // BITCOIN_WALLET_TEST_WALLET_TEST_FIXTURE_H
|