scripted-diff: refactor: CWallet::LoadWallet->PopulateWalletFromDB
There are too many functions in CWallet with names like "Load" and "Create", disambiguate what CWallet::LoadWallet does by renaming it to PopulateWalletFromDB. -BEGIN VERIFY SCRIPT- sed -i 's|\bLoadWallet()|PopulateWalletFromDB()|g' $(git grep -l 'LoadWallet()' -- ':(exclude)src/wallet/walletdb.cpp') -END VERIFY SCRIPT-
This commit is contained in:
1 parent
acc7f2a433
commit
f0a046094e
8 files changed
+10
-10
No files matched your search
@@ -306,7 +306,7 @@ void TestLoadWallet(const std::string& name, DatabaseFormat format, std::functio
|
||||
std::vector<bilingual_str> warnings;
|
||||
auto database{MakeWalletDatabase(name, options, status, error)};
|
||||
auto wallet{std::make_shared<CWallet>(chain.get(), "", std::move(database))};
|
||||
BOOST_CHECK_EQUAL(wallet->LoadWallet(), DBErrors::LOAD_OK);
|
||||
BOOST_CHECK_EQUAL(wallet->PopulateWalletFromDB(), DBErrors::LOAD_OK);
|
||||
WITH_LOCK(wallet->cs_wallet, f(wallet));
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_load_descriptors, TestingSetup)
|
||||
{
|
||||
// Now try to load the wallet and verify the error.
|
||||
const std::shared_ptr<CWallet> wallet(new CWallet(m_node.chain.get(), "", std::move(database)));
|
||||
BOOST_CHECK_EQUAL(wallet->LoadWallet(), DBErrors::UNKNOWN_DESCRIPTOR);
|
||||
BOOST_CHECK_EQUAL(wallet->PopulateWalletFromDB(), DBErrors::UNKNOWN_DESCRIPTOR);
|
||||
}
|
||||
|
||||
// Test 2
|
||||
@@ -78,7 +78,7 @@ BOOST_FIXTURE_TEST_CASE(wallet_load_descriptors, TestingSetup)
|
||||
{
|
||||
// Now try to load the wallet and verify the error.
|
||||
const std::shared_ptr<CWallet> wallet(new CWallet(m_node.chain.get(), "", std::move(database)));
|
||||
BOOST_CHECK_EQUAL(wallet->LoadWallet(), DBErrors::CORRUPT);
|
||||
BOOST_CHECK_EQUAL(wallet->PopulateWalletFromDB(), DBErrors::CORRUPT);
|
||||
BOOST_CHECK(found); // The error must be logged
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user