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 : #ifndef PIVX_WALLET_TEST_WALLET_TEST_FIXTURE_H 7 : #define PIVX_WALLET_TEST_WALLET_TEST_FIXTURE_H 8 : 9 : #include "test/librust/sapling_test_fixture.h" 10 : #include "wallet/wallet.h" 11 : 12 : 13 : /** Testing setup and teardown for wallet. 14 : */ 15 : struct WalletTestingSetupBase : public SaplingTestingSetup 16 : { 17 : WalletTestingSetupBase(const std::string& chainName, 18 : const std::string& wallet_name, 19 : std::unique_ptr<WalletDatabase> db); 20 : ~WalletTestingSetupBase(); 21 : CWallet m_wallet; 22 : }; 23 : 24 35 : struct WalletTestingSetup : public WalletTestingSetupBase 25 : { 26 : explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN); 27 : }; 28 : 29 17 : struct WalletRegTestingSetup : public WalletTestingSetup 30 : { 31 17 : WalletRegTestingSetup() : WalletTestingSetup(CBaseChainParams::REGTEST) {} 32 : }; 33 : 34 : #endif // PIVX_WALLET_TEST_WALLET_TEST_FIXTURE_H