Changeset View
Changeset View
Standalone View
Standalone View
src/dummywallet.cpp
// Copyright (c) 2018 The Bitcoin Core developers | // Copyright (c) 2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <logging.h> | #include <logging.h> | ||||
#include <support/allocators/secure.h> | #include <support/allocators/secure.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <walletinitinterface.h> | #include <walletinitinterface.h> | ||||
class CChainParams; | class CChainParams; | ||||
class CWallet; | class CWallet; | ||||
enum class WalletCreationStatus; | enum class WalletCreationStatus; | ||||
struct bilingual_str; | |||||
namespace interfaces { | namespace interfaces { | ||||
class Chain; | class Chain; | ||||
class Handler; | class Handler; | ||||
class Wallet; | class Wallet; | ||||
} // namespace interfaces | } // namespace interfaces | ||||
class DummyWalletInit : public WalletInitInterface { | class DummyWalletInit : public WalletInitInterface { | ||||
Show All 29 Lines | |||||
} | } | ||||
std::vector<std::shared_ptr<CWallet>> GetWallets() { | std::vector<std::shared_ptr<CWallet>> GetWallets() { | ||||
throw std::logic_error("Wallet function called in non-wallet build."); | throw std::logic_error("Wallet function called in non-wallet build."); | ||||
} | } | ||||
std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | std::shared_ptr<CWallet> LoadWallet(const CChainParams &chainParams, | ||||
interfaces::Chain &chain, | interfaces::Chain &chain, | ||||
const std::string &name, std::string &error, | const std::string &name, | ||||
std::vector<std::string> &warnings) { | bilingual_str &error, | ||||
std::vector<bilingual_str> &warnings) { | |||||
throw std::logic_error("Wallet function called in non-wallet build."); | throw std::logic_error("Wallet function called in non-wallet build."); | ||||
} | } | ||||
WalletCreationStatus CreateWallet(const CChainParams &chainParams, | WalletCreationStatus CreateWallet(const CChainParams &chainParams, | ||||
interfaces::Chain &chain, | interfaces::Chain &chain, | ||||
const SecureString &passphrase, | const SecureString &passphrase, | ||||
uint64_t wallet_creation_flags, | uint64_t wallet_creation_flags, | ||||
const std::string &name, std::string &error, | const std::string &name, bilingual_str &error, | ||||
std::vector<std::string> &warnings, | std::vector<bilingual_str> &warnings, | ||||
std::shared_ptr<CWallet> &result) { | std::shared_ptr<CWallet> &result) { | ||||
throw std::logic_error("Wallet function called in non-wallet build."); | throw std::logic_error("Wallet function called in non-wallet build."); | ||||
} | } | ||||
using LoadWalletFn = | using LoadWalletFn = | ||||
std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>; | std::function<void(std::unique_ptr<interfaces::Wallet> wallet)>; | ||||
std::unique_ptr<interfaces::Handler> | std::unique_ptr<interfaces::Handler> | ||||
HandleLoadWallet(LoadWalletFn load_wallet) { | HandleLoadWallet(LoadWalletFn load_wallet) { | ||||
Show All 10 Lines |