Line data Source code
1 : // Copyright (c) 2016-2021 The Bitcoin Core developers 2 : // Copyright (c) 2020-2021 The PIVX Core developers 3 : // Distributed under the MIT software license, see the accompanying 4 : // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 : 6 : #include "wallet/test/wallet_test_fixture.h" 7 : 8 : #include "rpc/server.h" 9 : #include "wallet/db.h" 10 : #include "wallet/rpcwallet.h" 11 : #include "wallet/wallet.h" 12 : 13 35 : WalletTestingSetupBase::WalletTestingSetupBase(const std::string& chainName, 14 : const std::string& wallet_name, 15 35 : std::unique_ptr<WalletDatabase> db) : 16 105 : SaplingTestingSetup(chainName), m_wallet(wallet_name, std::move(db)) 17 : { 18 35 : bool fFirstRun; 19 35 : m_wallet.LoadWallet(fFirstRun); 20 35 : RegisterValidationInterface(&m_wallet); 21 : 22 35 : RegisterWalletRPCCommands(tableRPC); 23 35 : } 24 : 25 35 : WalletTestingSetupBase::~WalletTestingSetupBase() 26 : { 27 35 : UnregisterValidationInterface(&m_wallet); 28 35 : } 29 : 30 35 : WalletTestingSetup::WalletTestingSetup(const std::string& chainName) : 31 70 : WalletTestingSetupBase(chainName, "mock", WalletDatabase::CreateMock()) {}