aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2021-12-22 13:44:55 -0500
committerRussell Yanofsky <russ@yanofsky.org>2021-12-22 13:44:55 -0500
commitff5f6dea5336075d1a6cace1112be3252d97540b (patch)
treee0faca531b734898819ad03ed0b06332229dd4aa /src/wallet
parent63b5dfac21613b984803347bfe81454da667016e (diff)
downloadbitcoin-ff5f6dea5336075d1a6cace1112be3252d97540b.tar.xz
scripted-diff: Rename interfaces::WalletClient to interfaces::WalletLoader
Name has been confusing since it was introduced, and it was pointed in recent review club as https://bitcoincore.reviews/10102 that it was particularly unclear how interfaces::WalletClient was different from interfaces::Wallet. -BEGIN VERIFY SCRIPT- ren() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; } ren WalletClient WalletLoader ren walletClient walletLoader ren wallet_client wallet_loader ren "wallet clients release the wallet" "wallet pointer owners release the wallet" ren "wallet client" "wallet loader" ren "Wallet client" "Wallet loader" -END VERIFY SCRIPT-
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/init.cpp6
-rw-r--r--src/wallet/interfaces.cpp14
-rw-r--r--src/wallet/test/init_test_fixture.cpp2
-rw-r--r--src/wallet/test/init_test_fixture.h2
-rw-r--r--src/wallet/test/init_tests.cpp14
-rw-r--r--src/wallet/test/wallet_test_fixture.cpp2
-rw-r--r--src/wallet/test/wallet_test_fixture.h2
-rw-r--r--src/wallet/wallet.h2
8 files changed, 22 insertions, 22 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 4ff049170e..5def02d96a 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -130,7 +130,7 @@ void WalletInit::Construct(NodeContext& node) const
LogPrintf("Wallet disabled!\n");
return;
}
- auto wallet_client = node.init->makeWalletClient(*node.chain);
- node.wallet_client = wallet_client.get();
- node.chain_clients.emplace_back(std::move(wallet_client));
+ auto wallet_loader = node.init->makeWalletLoader(*node.chain);
+ node.wallet_loader = wallet_loader.get();
+ node.chain_clients.emplace_back(std::move(wallet_loader));
}
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 04501ea5a2..54986413d6 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -40,7 +40,7 @@ using interfaces::MakeHandler;
using interfaces::Wallet;
using interfaces::WalletAddress;
using interfaces::WalletBalances;
-using interfaces::WalletClient;
+using interfaces::WalletLoader;
using interfaces::WalletOrderForm;
using interfaces::WalletTx;
using interfaces::WalletTxOut;
@@ -510,15 +510,15 @@ public:
std::shared_ptr<CWallet> m_wallet;
};
-class WalletClientImpl : public WalletClient
+class WalletLoaderImpl : public WalletLoader
{
public:
- WalletClientImpl(Chain& chain, ArgsManager& args)
+ WalletLoaderImpl(Chain& chain, ArgsManager& args)
{
m_context.chain = &chain;
m_context.args = &args;
}
- ~WalletClientImpl() override { UnloadWallets(m_context); }
+ ~WalletLoaderImpl() override { UnloadWallets(m_context); }
//! ChainClient methods
void registerRpcs() override
@@ -539,7 +539,7 @@ public:
void stop() override { return StopWallets(m_context); }
void setMockTime(int64_t time) override { return SetMockTime(time); }
- //! WalletClient methods
+ //! WalletLoader methods
std::unique_ptr<Wallet> createWallet(const std::string& name, const SecureString& passphrase, uint64_t wallet_creation_flags, bilingual_str& error, std::vector<bilingual_str>& warnings) override
{
std::shared_ptr<CWallet> wallet;
@@ -600,8 +600,8 @@ public:
namespace interfaces {
std::unique_ptr<Wallet> MakeWallet(WalletContext& context, const std::shared_ptr<CWallet>& wallet) { return wallet ? std::make_unique<wallet::WalletImpl>(context, wallet) : nullptr; }
-std::unique_ptr<WalletClient> MakeWalletClient(Chain& chain, ArgsManager& args)
+std::unique_ptr<WalletLoader> MakeWalletLoader(Chain& chain, ArgsManager& args)
{
- return std::make_unique<wallet::WalletClientImpl>(chain, args);
+ return std::make_unique<wallet::WalletLoaderImpl>(chain, args);
}
} // namespace interfaces
diff --git a/src/wallet/test/init_test_fixture.cpp b/src/wallet/test/init_test_fixture.cpp
index 170675c035..ade2813e0a 100644
--- a/src/wallet/test/init_test_fixture.cpp
+++ b/src/wallet/test/init_test_fixture.cpp
@@ -11,7 +11,7 @@
InitWalletDirTestingSetup::InitWalletDirTestingSetup(const std::string& chainName) : BasicTestingSetup(chainName)
{
- m_wallet_client = MakeWalletClient(*m_node.chain, *Assert(m_node.args));
+ m_wallet_loader = MakeWalletLoader(*m_node.chain, *Assert(m_node.args));
std::string sep;
sep += fs::path::preferred_separator;
diff --git a/src/wallet/test/init_test_fixture.h b/src/wallet/test/init_test_fixture.h
index 37ae907de5..485aa50658 100644
--- a/src/wallet/test/init_test_fixture.h
+++ b/src/wallet/test/init_test_fixture.h
@@ -19,7 +19,7 @@ struct InitWalletDirTestingSetup: public BasicTestingSetup {
fs::path m_datadir;
fs::path m_cwd;
std::map<std::string, fs::path> m_walletdir_path_cases;
- std::unique_ptr<interfaces::WalletClient> m_wallet_client;
+ std::unique_ptr<interfaces::WalletLoader> m_wallet_loader;
};
#endif // BITCOIN_WALLET_TEST_INIT_TEST_FIXTURE_H
diff --git a/src/wallet/test/init_tests.cpp b/src/wallet/test/init_tests.cpp
index 222c2bf4b7..3bbf18043d 100644
--- a/src/wallet/test/init_tests.cpp
+++ b/src/wallet/test/init_tests.cpp
@@ -15,7 +15,7 @@ BOOST_FIXTURE_TEST_SUITE(init_tests, InitWalletDirTestingSetup)
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_default)
{
SetWalletDir(m_walletdir_path_cases["default"]);
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == true);
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
@@ -25,7 +25,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_default)
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_custom)
{
SetWalletDir(m_walletdir_path_cases["custom"]);
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == true);
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
fs::path expected_path = fs::canonical(m_walletdir_path_cases["custom"]);
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_does_not_exist)
SetWalletDir(m_walletdir_path_cases["nonexistent"]);
{
ASSERT_DEBUG_LOG("does not exist");
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == false);
}
}
@@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_is_not_directory)
SetWalletDir(m_walletdir_path_cases["file"]);
{
ASSERT_DEBUG_LOG("is not a directory");
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == false);
}
}
@@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_is_not_relative)
SetWalletDir(m_walletdir_path_cases["relative"]);
{
ASSERT_DEBUG_LOG("is a relative path");
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == false);
}
}
@@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_is_not_relative)
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing)
{
SetWalletDir(m_walletdir_path_cases["trailing"]);
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == true);
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing)
BOOST_AUTO_TEST_CASE(walletinit_verify_walletdir_no_trailing2)
{
SetWalletDir(m_walletdir_path_cases["trailing2"]);
- bool result = m_wallet_client->verify();
+ bool result = m_wallet_loader->verify();
BOOST_CHECK(result == true);
fs::path walletdir = fs::PathFromString(gArgs.GetArg("-walletdir", ""));
fs::path expected_path = fs::canonical(m_walletdir_path_cases["default"]);
diff --git a/src/wallet/test/wallet_test_fixture.cpp b/src/wallet/test/wallet_test_fixture.cpp
index 762702522e..83bc75528d 100644
--- a/src/wallet/test/wallet_test_fixture.cpp
+++ b/src/wallet/test/wallet_test_fixture.cpp
@@ -12,7 +12,7 @@ WalletTestingSetup::WalletTestingSetup(const std::string& chainName)
{
m_wallet.LoadWallet();
m_chain_notifications_handler = m_node.chain->handleNotifications({ &m_wallet, [](CWallet*) {} });
- m_wallet_client->registerRpcs();
+ m_wallet_loader->registerRpcs();
}
WalletTestingSetup::~WalletTestingSetup()
diff --git a/src/wallet/test/wallet_test_fixture.h b/src/wallet/test/wallet_test_fixture.h
index 8bf2d36227..02d5707e36 100644
--- a/src/wallet/test/wallet_test_fixture.h
+++ b/src/wallet/test/wallet_test_fixture.h
@@ -21,7 +21,7 @@ struct WalletTestingSetup : public TestingSetup {
explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);
~WalletTestingSetup();
- std::unique_ptr<interfaces::WalletClient> m_wallet_client = interfaces::MakeWalletClient(*m_node.chain, *Assert(m_node.args));
+ std::unique_ptr<interfaces::WalletLoader> m_wallet_loader = interfaces::MakeWalletLoader(*m_node.chain, *Assert(m_node.args));
CWallet m_wallet;
std::unique_ptr<interfaces::Handler> m_chain_notifications_handler;
};
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index e2a2aebeb5..30777dbe2c 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -48,7 +48,7 @@ struct bilingual_str;
//! Explicitly unload and delete the wallet.
//! Blocks the current thread after signaling the unload intent so that all
-//! wallet clients release the wallet.
+//! wallet pointer owners release the wallet.
//! Note that, when blocking is not required, the wallet is implicitly unloaded
//! by the shared pointer deleter.
void UnloadWallet(std::shared_ptr<CWallet>&& wallet);