1 // Copyright (c) 2016-2018 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 #include <wallet/test/wallet_test_fixture.h> 6 7 #include <rpc/server.h> 8 #include <wallet/db.h> 9 #include <wallet/rpcwallet.h> 10 WalletTestingSetup(const std::string & chainName)11WalletTestingSetup::WalletTestingSetup(const std::string& chainName): 12 TestingSetup(chainName), m_wallet(*m_chain, WalletLocation(), WalletDatabase::CreateMock()) 13 { 14 bool fFirstRun; 15 m_wallet.LoadWallet(fFirstRun); 16 RegisterValidationInterface(&m_wallet); 17 18 RegisterWalletRPCCommands(tableRPC); 19 } 20 ~WalletTestingSetup()21WalletTestingSetup::~WalletTestingSetup() 22 { 23 UnregisterValidationInterface(&m_wallet); 24 } 25