File tree Expand file tree Collapse file tree 2 files changed +16
-19
lines changed Expand file tree Collapse file tree 2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change 1
- // Copyright (c) 2016 The Bitcoin Core developers
2
- // Copyright (c) 2020 The PIVX developers
1
+ // Copyright (c) 2016-2021 The Bitcoin Core developers
2
+ // Copyright (c) 2020-2021 The PIVX developers
3
3
// Distributed under the MIT software license, see the accompanying
4
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
5
6
6
#include " wallet/test/wallet_test_fixture.h"
7
7
8
8
#include " rpc/server.h"
9
9
#include " wallet/db.h"
10
- #include " wallet/wallet.h"
11
10
#include " wallet/rpcwallet.h"
12
-
13
- void clean ()
14
- {
15
- delete pwalletMain;
16
- pwalletMain = nullptr ;
17
-
18
- bitdb.Flush (true );
19
- bitdb.Reset ();
20
- }
11
+ #include " wallet/wallet.h"
21
12
22
13
WalletTestingSetup::WalletTestingSetup (const std::string& chainName):
23
14
SaplingTestingSetup(chainName)
24
15
{
25
- clean (); // todo: research why we have an initialized bitdb here.
26
16
bitdb.MakeMock ();
27
- RegisterWalletRPCCommands (tableRPC);
28
17
29
18
bool fFirstRun ;
30
19
std::unique_ptr<CWalletDBWrapper> dbw (new CWalletDBWrapper (&bitdb, " wallet_test.dat" ));
31
20
pwalletMain = new CWallet (std::move (dbw));
32
21
pwalletMain->LoadWallet (fFirstRun );
33
22
RegisterValidationInterface (pwalletMain);
23
+
24
+ RegisterWalletRPCCommands (tableRPC);
34
25
}
35
26
36
27
WalletTestingSetup::~WalletTestingSetup ()
37
28
{
38
29
UnregisterValidationInterface (pwalletMain);
39
- clean ();
30
+ delete pwalletMain;
31
+ pwalletMain = nullptr ;
32
+
33
+ bitdb.Flush (true );
34
+ bitdb.Reset ();
40
35
}
Original file line number Diff line number Diff line change 1
- // Copyright (c) 2016 The Bitcoin Core developers
1
+ // Copyright (c) 2016-2021 The Bitcoin Core developers
2
+ // Copyright (c) 2020-2021 The PIVX developers
2
3
// Distributed under the MIT software license, see the accompanying
3
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
5
- #ifndef BITCOIN_WALLET_TEST_FIXTURE_H
6
- #define BITCOIN_WALLET_TEST_FIXTURE_H
6
+ #ifndef PIVX_WALLET_TEST_FIXTURE_H
7
+ #define PIVX_WALLET_TEST_FIXTURE_H
7
8
8
9
#include " test/librust/sapling_test_fixture.h"
9
10
11
+
10
12
/* * Testing setup and teardown for wallet.
11
13
*/
12
14
struct WalletTestingSetup : public SaplingTestingSetup
@@ -20,5 +22,5 @@ struct WalletRegTestingSetup : public WalletTestingSetup
20
22
WalletRegTestingSetup () : WalletTestingSetup(CBaseChainParams::REGTEST) {}
21
23
};
22
24
23
- #endif
25
+ #endif // PIVX_WALLET_TEST_FIXTURE_H
24
26
You can’t perform that action at this time.
0 commit comments