@@ -112,7 +112,7 @@ class Wallet
112112 virtual std::string getWalletName () = 0;
113113
114114 // Get a new address.
115- virtual util::Result<CTxDestination> getNewDestination (const std::string label) = 0;
115+ virtual util::Result<CTxDestination> getNewDestination (const std::string& label) = 0;
116116
117117 // ! Get public key.
118118 virtual bool getPubKey (const CScript& script, const CKeyID& address, CPubKey& pub_key) = 0;
@@ -347,35 +347,35 @@ class Wallet
347347class WalletLoader : public ChainClient
348348{
349349public:
350- // ! Register non-core wallet RPCs
351- virtual void registerOtherRpcs (const Span<const CRPCCommand>& commands) = 0;
350+ // ! Register non-core wallet RPCs
351+ virtual void registerOtherRpcs (const Span<const CRPCCommand>& commands) = 0;
352352
353- // ! Create new wallet.
354- virtual 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) = 0;
353+ // ! Create new wallet.
354+ virtual util::Result< std::unique_ptr<Wallet>> createWallet (const std::string& name, const SecureString& passphrase, uint64_t wallet_creation_flags, std::vector<bilingual_str>& warnings) = 0;
355355
356- // ! Load existing wallet.
357- virtual std::unique_ptr<Wallet> loadWallet (const std::string& name, bilingual_str& error , std::vector<bilingual_str>& warnings) = 0;
356+ // ! Load existing wallet.
357+ virtual util::Result< std::unique_ptr<Wallet>> loadWallet (const std::string& name, std::vector<bilingual_str>& warnings) = 0;
358358
359- // ! Return default wallet directory.
360- virtual std::string getWalletDir () = 0;
359+ // ! Return default wallet directory.
360+ virtual std::string getWalletDir () = 0;
361361
362- // ! Restore backup wallet
363- virtual util::Result<std::unique_ptr<Wallet>> restoreWallet (const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) = 0;
362+ // ! Restore backup wallet
363+ virtual util::Result<std::unique_ptr<Wallet>> restoreWallet (const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) = 0;
364364
365- // ! Return available wallets in wallet directory.
366- virtual std::vector<std::string> listWalletDir () = 0;
365+ // ! Return available wallets in wallet directory.
366+ virtual std::vector<std::string> listWalletDir () = 0;
367367
368- // ! Return interfaces for accessing wallets (if any).
369- virtual std::vector<std::unique_ptr<Wallet>> getWallets () = 0;
368+ // ! Return interfaces for accessing wallets (if any).
369+ virtual std::vector<std::unique_ptr<Wallet>> getWallets () = 0;
370370
371- // ! Register handler for load wallet messages. This callback is triggered by
372- // ! createWallet and loadWallet above, and also triggered when wallets are
373- // ! loaded at startup or by RPC.
374- using LoadWalletFn = std::function<void (std::unique_ptr<Wallet> wallet)>;
375- virtual std::unique_ptr<Handler> handleLoadWallet (LoadWalletFn fn) = 0;
371+ // ! Register handler for load wallet messages. This callback is triggered by
372+ // ! createWallet and loadWallet above, and also triggered when wallets are
373+ // ! loaded at startup or by RPC.
374+ using LoadWalletFn = std::function<void (std::unique_ptr<Wallet> wallet)>;
375+ virtual std::unique_ptr<Handler> handleLoadWallet (LoadWalletFn fn) = 0;
376376
377- // ! Return pointer to internal context, useful for testing.
378- virtual wallet::WalletContext* context () { return nullptr ; }
377+ // ! Return pointer to internal context, useful for testing.
378+ virtual wallet::WalletContext* context () { return nullptr ; }
379379};
380380
381381// ! Information about one wallet address.
0 commit comments