aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 19:03:43 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-09 19:29:54 +0200
commit0700b6f778d9dcef6e1e733d593cc63f195d4a3a (patch)
tree1eb5d7d6f5e3a76c3247f85050fc9f9d8794cb08 /src/wallet/test
parenta7cbe38ae2dd7e983a5e1bc31524fa9bd791727e (diff)
parent9b0f0c5513f74825b06a728ab9bb2fd0e4224c9f (diff)
downloadbitcoin-0700b6f778d9dcef6e1e733d593cc63f195d4a3a.tar.xz
Merge #11851: scripted-diff: Rename wallet database classes
9b0f0c5 Add m_ prefix to WalletBatch::m_batch (Russell Yanofsky) 398c6f0 Update walletdb comment after renaming. (Russell Yanofsky) ea23945 scripted-diff: Rename wallet database classes (Russell Yanofsky) Pull request description: Scripted diff to rename some wallet classes. Motivated by discussion in https://github.com/bitcoin/bitcoin/pull/11687#discussion_r155354119 | Current | New | | ---------------- | ------------------- | | CDBEnv | BerkeleyEnvironment | | CDB | BerkeleyBatch | | CWalletDBWrapper | WalletDatabase | | CWalletDB | WalletBatch | Berkeley\* classes are intended to contain BDB specific code, while Wallet\* classes are intended to be more backend-agnostic. Also renamed associated variables: | Current | New | | ------------------- | --------------- | | dbw | database | | pwalletdb | batch | | pwalletdbEncryption | encrypted_batch | Tree-SHA512: 372f2e24b2deb59d4792b5ed578aaf0cce51b6db41c400bef5d0c2cd7833e62ae4d4afa0f6000268d52e15b20f737c5a55f1cecf7768556a782fd8cd6fe051d9
Diffstat (limited to 'src/wallet/test')
-rw-r--r--src/wallet/test/coinselector_tests.cpp2
-rw-r--r--src/wallet/test/wallet_test_fixture.cpp2
-rw-r--r--src/wallet/test/wallet_tests.cpp14
3 files changed, 9 insertions, 9 deletions
diff --git a/src/wallet/test/coinselector_tests.cpp b/src/wallet/test/coinselector_tests.cpp
index 184a8a3f1f..ac47d4448a 100644
--- a/src/wallet/test/coinselector_tests.cpp
+++ b/src/wallet/test/coinselector_tests.cpp
@@ -28,7 +28,7 @@ std::vector<std::unique_ptr<CWalletTx>> wtxn;
typedef std::set<CInputCoin> CoinSet;
static std::vector<COutput> vCoins;
-static CWallet testWallet("dummy", CWalletDBWrapper::CreateDummy());
+static CWallet testWallet("dummy", WalletDatabase::CreateDummy());
static CAmount balance = 0;
CoinEligibilityFilter filter_standard(1, 6, 0);
diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp
index 1452c5b548..6129e337ce 100644
--- a/src/wallet/test/wallet_test_fixture.cpp
+++ b/src/wallet/test/wallet_test_fixture.cpp
@@ -8,7 +8,7 @@
#include <wallet/db.h>
WalletTestingSetup::WalletTestingSetup(const std::string& chainName):
- TestingSetup(chainName), m_wallet("mock", CWalletDBWrapper::CreateMock())
+ TestingSetup(chainName), m_wallet("mock", WalletDatabase::CreateMock())
{
bool fFirstRun;
m_wallet.LoadWallet(fFirstRun);
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index e93e0f1966..727c6caf96 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -46,7 +46,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
// Verify ScanForWalletTransactions picks up transactions in both the old
// and new block files.
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
AddKey(wallet, coinbaseKey);
WalletRescanReserver reserver(&wallet);
reserver.reserve();
@@ -61,7 +61,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
// Verify ScanForWalletTransactions only picks transactions in the new block
// file.
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
AddKey(wallet, coinbaseKey);
WalletRescanReserver reserver(&wallet);
reserver.reserve();
@@ -73,7 +73,7 @@ BOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)
// before the missing block, and success for a key whose creation time is
// after.
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
vpwallets.insert(vpwallets.begin(), &wallet);
UniValue keys;
keys.setArray();
@@ -132,7 +132,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
// Import key into wallet and call dumpwallet to create backup file.
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
LOCK(wallet.cs_wallet);
wallet.mapKeyMetadata[coinbaseKey.GetPubKey().GetID()].nCreateTime = KEY_TIME;
wallet.AddKeyPubKey(coinbaseKey, coinbaseKey.GetPubKey());
@@ -147,7 +147,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
// Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME
// were scanned, and no prior blocks were scanned.
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
JSONRPCRequest request;
request.params.setArray();
@@ -177,7 +177,7 @@ BOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)
// debit functions.
BOOST_FIXTURE_TEST_CASE(coin_mark_dirty_immature_credit, TestChain100Setup)
{
- CWallet wallet("dummy", CWalletDBWrapper::CreateDummy());
+ CWallet wallet("dummy", WalletDatabase::CreateDummy());
CWalletTx wtx(&wallet, MakeTransactionRef(coinbaseTxns.back()));
LOCK2(cs_main, wallet.cs_wallet);
wtx.hashBlock = chainActive.Tip()->GetBlockHash();
@@ -270,7 +270,7 @@ public:
ListCoinsTestingSetup()
{
CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));
- wallet = MakeUnique<CWallet>("mock", CWalletDBWrapper::CreateMock());
+ wallet = MakeUnique<CWallet>("mock", WalletDatabase::CreateMock());
bool firstRun;
wallet->LoadWallet(firstRun);
AddKey(*wallet, coinbaseKey);