From e4f435047121886edb6e6a6c4e4998e44ed2e36a Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Thu, 28 May 2020 09:48:30 -0400 Subject: refactor: Move wallet methods out of chain.h and node.h Add WalletClient interface so node interface is cleaner and don't need wallet-specific methods. The new NodeContext::wallet_client pointer will also be needed to eliminate global wallet variables like ::vpwallets, because createWallet(), loadWallet(), getWallets(), etc methods called by the GUI need a way to get a reference to the list of open wallets if it is no longer a global variable. Also tweaks splash screen registration for load wallet events to be delayed until after wallet client is created. --- src/dummywallet.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) (limited to 'src/dummywallet.cpp') diff --git a/src/dummywallet.cpp b/src/dummywallet.cpp index 380d4eb8ac..e54c2daaeb 100644 --- a/src/dummywallet.cpp +++ b/src/dummywallet.cpp @@ -4,11 +4,8 @@ #include #include -#include class CWallet; -enum class WalletCreationStatus; -struct bilingual_str; namespace interfaces { class Chain; @@ -59,37 +56,6 @@ void DummyWalletInit::AddWalletOptions(ArgsManager& argsman) const const WalletInitInterface& g_wallet_init_interface = DummyWalletInit(); -fs::path GetWalletDir() -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - -std::vector ListWalletDir() -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - -std::vector> GetWallets() -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - -std::shared_ptr LoadWallet(interfaces::Chain& chain, const std::string& name, bilingual_str& error, std::vector& warnings) -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - -WalletCreationStatus CreateWallet(interfaces::Chain& chain, const SecureString& passphrase, uint64_t wallet_creation_flags, const std::string& name, bilingual_str& error, std::vector& warnings, std::shared_ptr& result) -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - -using LoadWalletFn = std::function wallet)>; -std::unique_ptr HandleLoadWallet(LoadWalletFn load_wallet) -{ - throw std::logic_error("Wallet function called in non-wallet build."); -} - namespace interfaces { std::unique_ptr MakeWallet(const std::shared_ptr& wallet) -- cgit v1.2.3