2021-12-30 19:36:57 +02:00
|
|
|
// Copyright (c) 2016-2021 The Bitcoin Core developers
|
2016-08-22 09:24:50 +02:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2017-11-10 13:57:53 +13:00
|
|
|
#include <wallet/test/wallet_test_fixture.h>
|
2016-04-18 14:54:57 +02:00
|
|
|
|
2021-10-31 13:19:03 +02:00
|
|
|
#include <scheduler.h>
|
|
|
|
|
2021-11-12 11:13:29 -05:00
|
|
|
namespace wallet {
|
2019-04-17 13:27:02 -04:00
|
|
|
WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
|
|
|
|
: TestingSetup(chainName),
|
2021-09-09 07:53:16 +02:00
|
|
|
m_wallet(m_node.chain.get(), "", m_args, CreateMockWalletDatabase())
|
2016-04-18 14:54:57 +02:00
|
|
|
{
|
2020-12-18 17:45:11 +01:00
|
|
|
m_wallet.LoadWallet();
|
2020-12-07 20:46:03 -05:00
|
|
|
m_chain_notifications_handler = m_node.chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
|
2021-12-22 13:44:55 -05:00
|
|
|
m_wallet_loader->registerRpcs();
|
2016-04-18 14:54:57 +02:00
|
|
|
}
|
2021-10-31 13:19:03 +02:00
|
|
|
|
|
|
|
WalletTestingSetup::~WalletTestingSetup()
|
|
|
|
{
|
|
|
|
if (m_node.scheduler) m_node.scheduler->stop();
|
|
|
|
}
|
2021-11-12 11:13:29 -05:00
|
|
|
} // namespace wallet
|