Bitcoin Core  22.99.0
P2P Digital Currency
wallettests.cpp
Go to the documentation of this file.
1 // Copyright (c) 2015-2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <qt/test/wallettests.h>
6 #include <qt/test/util.h>
7 
8 #include <interfaces/chain.h>
9 #include <interfaces/node.h>
10 #include <qt/bitcoinamountfield.h>
11 #include <qt/clientmodel.h>
12 #include <qt/optionsmodel.h>
13 #include <qt/platformstyle.h>
14 #include <qt/qvalidatedlineedit.h>
15 #include <qt/sendcoinsdialog.h>
16 #include <qt/sendcoinsentry.h>
18 #include <qt/transactionview.h>
19 #include <qt/walletmodel.h>
20 #include <key_io.h>
21 #include <test/util/setup_common.h>
22 #include <validation.h>
23 #include <wallet/wallet.h>
24 #include <qt/overviewpage.h>
25 #include <qt/receivecoinsdialog.h>
28 
29 #include <chrono>
30 #include <memory>
31 
32 #include <QAbstractButton>
33 #include <QAction>
34 #include <QApplication>
35 #include <QCheckBox>
36 #include <QPushButton>
37 #include <QTimer>
38 #include <QVBoxLayout>
39 #include <QTextEdit>
40 #include <QListView>
41 #include <QDialogButtonBox>
42 
43 using wallet::AddWallet;
44 using wallet::CWallet;
51 
52 namespace
53 {
55 void ConfirmSend(QString* text = nullptr, bool cancel = false)
56 {
57  QTimer::singleShot(0, [text, cancel]() {
58  for (QWidget* widget : QApplication::topLevelWidgets()) {
59  if (widget->inherits("SendConfirmationDialog")) {
60  SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget);
61  if (text) *text = dialog->text();
62  QAbstractButton* button = dialog->button(cancel ? QMessageBox::Cancel : QMessageBox::Yes);
63  button->setEnabled(true);
64  button->click();
65  }
66  }
67  });
68 }
69 
71 uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDestination& address, CAmount amount, bool rbf)
72 {
73  QVBoxLayout* entries = sendCoinsDialog.findChild<QVBoxLayout*>("entries");
74  SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(entries->itemAt(0)->widget());
75  entry->findChild<QValidatedLineEdit*>("payTo")->setText(QString::fromStdString(EncodeDestination(address)));
76  entry->findChild<BitcoinAmountField*>("payAmount")->setValue(amount);
77  sendCoinsDialog.findChild<QFrame*>("frameFee")
78  ->findChild<QFrame*>("frameFeeSelection")
79  ->findChild<QCheckBox*>("optInRBF")
80  ->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
81  uint256 txid;
82  boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](const uint256& hash, ChangeType status) {
83  if (status == CT_NEW) txid = hash;
84  }));
85  ConfirmSend();
86  bool invoked = QMetaObject::invokeMethod(&sendCoinsDialog, "sendButtonClicked", Q_ARG(bool, false));
87  assert(invoked);
88  return txid;
89 }
90 
92 QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
93 {
94  QString hash = QString::fromStdString(txid.ToString());
95  int rows = model.rowCount({});
96  for (int row = 0; row < rows; ++row) {
97  QModelIndex index = model.index(row, 0, {});
98  if (model.data(index, TransactionTableModel::TxHashRole) == hash) {
99  return index;
100  }
101  }
102  return {};
103 }
104 
106 void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
107 {
108  QTableView* table = view.findChild<QTableView*>("transactionView");
109  QModelIndex index = FindTx(*table->selectionModel()->model(), txid);
110  QVERIFY2(index.isValid(), "Could not find BumpFee txid");
111 
112  // Select row in table, invoke context menu, and make sure bumpfee action is
113  // enabled or disabled as expected.
114  QAction* action = view.findChild<QAction*>("bumpFeeAction");
115  table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
116  action->setEnabled(expectDisabled);
117  table->customContextMenuRequested({});
118  QCOMPARE(action->isEnabled(), !expectDisabled);
119 
120  action->setEnabled(true);
121  QString text;
122  if (expectError.empty()) {
123  ConfirmSend(&text, cancel);
124  } else {
125  ConfirmMessage(&text, 0ms);
126  }
127  action->trigger();
128  QVERIFY(text.indexOf(QString::fromStdString(expectError)) != -1);
129 }
130 
132 //
133 // Test widgets can be debugged interactively calling show() on them and
134 // manually running the event loop, e.g.:
135 //
136 // sendCoinsDialog.show();
137 // QEventLoop().exec();
138 //
139 // This also requires overriding the default minimal Qt platform:
140 //
141 // QT_QPA_PLATFORM=xcb src/qt/test/test_bitcoin-qt # Linux
142 // QT_QPA_PLATFORM=windows src/qt/test/test_bitcoin-qt # Windows
143 // QT_QPA_PLATFORM=cocoa src/qt/test/test_bitcoin-qt # macOS
144 void TestGUI(interfaces::Node& node)
145 {
146  // Set up wallet and chain with 105 blocks (5 mature blocks for spending).
147  TestChain100Setup test;
148  for (int i = 0; i < 5; ++i) {
150  }
151  auto wallet_loader = interfaces::MakeWalletLoader(*test.m_node.chain, *Assert(test.m_node.args));
152  test.m_node.wallet_loader = wallet_loader.get();
153  node.setContext(&test.m_node);
154  const std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>(node.context()->chain.get(), "", gArgs, CreateMockWalletDatabase());
155  wallet->LoadWallet();
156  wallet->SetWalletFlag(WALLET_FLAG_DESCRIPTORS);
157  {
158  LOCK(wallet->cs_wallet);
159  wallet->SetupDescriptorScriptPubKeyMans();
160 
161  // Add the coinbase key
162  FlatSigningProvider provider;
163  std::string error;
164  std::unique_ptr<Descriptor> desc = Parse("combo(" + EncodeSecret(test.coinbaseKey) + ")", provider, error, /* require_checksum=*/ false);
165  assert(desc);
166  WalletDescriptor w_desc(std::move(desc), 0, 0, 1, 1);
167  if (!wallet->AddWalletDescriptor(w_desc, provider, "", false)) assert(false);
168  CTxDestination dest = GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type);
169  wallet->SetAddressBook(dest, "", "receive");
170  wallet->SetLastBlockProcessed(105, node.context()->chainman->ActiveChain().Tip()->GetBlockHash());
171  }
172  {
173  WalletRescanReserver reserver(*wallet);
174  reserver.reserve();
175  CWallet::ScanResult result = wallet->ScanForWalletTransactions(Params().GetConsensus().hashGenesisBlock, 0 /* block height */, {} /* max height */, reserver, true /* fUpdate */);
176  QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
177  QCOMPARE(result.last_scanned_block, node.context()->chainman->ActiveChain().Tip()->GetBlockHash());
178  QVERIFY(result.last_failed_block.IsNull());
179  }
180  wallet->SetBroadcastTransactions(true);
181 
182  // Create widgets for sending coins and listing transactions.
183  std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate("other"));
184  SendCoinsDialog sendCoinsDialog(platformStyle.get());
185  TransactionView transactionView(platformStyle.get());
186  OptionsModel optionsModel;
187  ClientModel clientModel(node, &optionsModel);
188  WalletContext& context = *node.walletLoader().context();
190  WalletModel walletModel(interfaces::MakeWallet(context, wallet), clientModel, platformStyle.get());
191  RemoveWallet(context, wallet, /* load_on_start= */ std::nullopt);
192  sendCoinsDialog.setModel(&walletModel);
193  transactionView.setModel(&walletModel);
194 
195  {
196  // Check balance in send dialog
197  QLabel* balanceLabel = sendCoinsDialog.findChild<QLabel*>("labelBalance");
198  QString balanceText = balanceLabel->text();
199  int unit = walletModel.getOptionsModel()->getDisplayUnit();
200  CAmount balance = walletModel.wallet().getBalance();
201  QString balanceComparison = BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::SeparatorStyle::ALWAYS);
202  QCOMPARE(balanceText, balanceComparison);
203  }
204 
205  // Send two transactions, and verify they are added to transaction list.
206  TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
207  QCOMPARE(transactionTableModel->rowCount({}), 105);
208  uint256 txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, false /* rbf */);
209  uint256 txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, true /* rbf */);
210  QCOMPARE(transactionTableModel->rowCount({}), 107);
211  QVERIFY(FindTx(*transactionTableModel, txid1).isValid());
212  QVERIFY(FindTx(*transactionTableModel, txid2).isValid());
213 
214  // Call bumpfee. Test disabled, canceled, enabled, then failing cases.
215  BumpFee(transactionView, txid1, true /* expect disabled */, "not BIP 125 replaceable" /* expected error */, false /* cancel */);
216  BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);
217  BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);
218  BumpFee(transactionView, txid2, true /* expect disabled */, "already bumped" /* expected error */, false /* cancel */);
219 
220  // Check current balance on OverviewPage
221  OverviewPage overviewPage(platformStyle.get());
222  overviewPage.setWalletModel(&walletModel);
223  QLabel* balanceLabel = overviewPage.findChild<QLabel*>("labelBalance");
224  QString balanceText = balanceLabel->text().trimmed();
225  int unit = walletModel.getOptionsModel()->getDisplayUnit();
226  CAmount balance = walletModel.wallet().getBalance();
227  QString balanceComparison = BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::SeparatorStyle::ALWAYS);
228  QCOMPARE(balanceText, balanceComparison);
229 
230  // Check Request Payment button
231  ReceiveCoinsDialog receiveCoinsDialog(platformStyle.get());
232  receiveCoinsDialog.setModel(&walletModel);
233  RecentRequestsTableModel* requestTableModel = walletModel.getRecentRequestsTableModel();
234 
235  // Label input
236  QLineEdit* labelInput = receiveCoinsDialog.findChild<QLineEdit*>("reqLabel");
237  labelInput->setText("TEST_LABEL_1");
238 
239  // Amount input
240  BitcoinAmountField* amountInput = receiveCoinsDialog.findChild<BitcoinAmountField*>("reqAmount");
241  amountInput->setValue(1);
242 
243  // Message input
244  QLineEdit* messageInput = receiveCoinsDialog.findChild<QLineEdit*>("reqMessage");
245  messageInput->setText("TEST_MESSAGE_1");
246  int initialRowCount = requestTableModel->rowCount({});
247  QPushButton* requestPaymentButton = receiveCoinsDialog.findChild<QPushButton*>("receiveButton");
248  requestPaymentButton->click();
249  QString address;
250  for (QWidget* widget : QApplication::topLevelWidgets()) {
251  if (widget->inherits("ReceiveRequestDialog")) {
252  ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);
253  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("payment_header")->text(), QString("Payment information"));
254  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("uri_tag")->text(), QString("URI:"));
255  QString uri = receiveRequestDialog->QObject::findChild<QLabel*>("uri_content")->text();
256  QCOMPARE(uri.count("bitcoin:"), 2);
257  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("address_tag")->text(), QString("Address:"));
258  QVERIFY(address.isEmpty());
259  address = receiveRequestDialog->QObject::findChild<QLabel*>("address_content")->text();
260  QVERIFY(!address.isEmpty());
261 
262  QCOMPARE(uri.count("amount=0.00000001"), 2);
263  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("amount_tag")->text(), QString("Amount:"));
264  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("amount_content")->text(), QString::fromStdString("0.00000001 " + CURRENCY_UNIT));
265 
266  QCOMPARE(uri.count("label=TEST_LABEL_1"), 2);
267  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("label_tag")->text(), QString("Label:"));
268  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("label_content")->text(), QString("TEST_LABEL_1"));
269 
270  QCOMPARE(uri.count("message=TEST_MESSAGE_1"), 2);
271  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("message_tag")->text(), QString("Message:"));
272  QCOMPARE(receiveRequestDialog->QObject::findChild<QLabel*>("message_content")->text(), QString("TEST_MESSAGE_1"));
273  }
274  }
275 
276  // Clear button
277  QPushButton* clearButton = receiveCoinsDialog.findChild<QPushButton*>("clearButton");
278  clearButton->click();
279  QCOMPARE(labelInput->text(), QString(""));
280  QCOMPARE(amountInput->value(), CAmount(0));
281  QCOMPARE(messageInput->text(), QString(""));
282 
283  // Check addition to history
284  int currentRowCount = requestTableModel->rowCount({});
285  QCOMPARE(currentRowCount, initialRowCount+1);
286 
287  // Check addition to wallet
288  std::vector<std::string> requests = walletModel.wallet().getAddressReceiveRequests();
289  QCOMPARE(requests.size(), size_t{1});
290  RecentRequestEntry entry;
291  CDataStream{MakeUCharSpan(requests[0]), SER_DISK, CLIENT_VERSION} >> entry;
292  QCOMPARE(entry.nVersion, int{1});
293  QCOMPARE(entry.id, int64_t{1});
294  QVERIFY(entry.date.isValid());
295  QCOMPARE(entry.recipient.address, address);
296  QCOMPARE(entry.recipient.label, QString{"TEST_LABEL_1"});
297  QCOMPARE(entry.recipient.amount, CAmount{1});
298  QCOMPARE(entry.recipient.message, QString{"TEST_MESSAGE_1"});
299  QCOMPARE(entry.recipient.sPaymentRequest, std::string{});
300  QCOMPARE(entry.recipient.authenticatedMerchant, QString{});
301 
302  // Check Remove button
303  QTableView* table = receiveCoinsDialog.findChild<QTableView*>("recentRequestsView");
304  table->selectRow(currentRowCount-1);
305  QPushButton* removeRequestButton = receiveCoinsDialog.findChild<QPushButton*>("removeRequestButton");
306  removeRequestButton->click();
307  QCOMPARE(requestTableModel->rowCount({}), currentRowCount-1);
308 
309  // Check removal from wallet
310  QCOMPARE(walletModel.wallet().getAddressReceiveRequests().size(), size_t{0});
311 }
312 
313 } // namespace
314 
316 {
317 #ifdef Q_OS_MAC
318  if (QApplication::platformName() == "minimal") {
319  // Disable for mac on "minimal" platform to avoid crashes inside the Qt
320  // framework when it tries to look up unimplemented cocoa functions,
321  // and fails to handle returned nulls
322  // (https://bugreports.qt.io/browse/QTBUG-49686).
323  QWARN("Skipping WalletTests on mac build with 'minimal' platform set due to Qt bugs. To run AppTests, invoke "
324  "with 'QT_QPA_PLATFORM=cocoa test_bitcoin-qt' on mac, or else use a linux or windows build.");
325  return;
326  }
327 #endif
328  TestGUI(m_node);
329 }
SendCoinsRecipient::amount
CAmount amount
Definition: sendcoinsrecipient.h:33
TransactionView
Widget showing the transaction list for a wallet, including a filter row.
Definition: transactionview.h:32
RecentRequestEntry::recipient
SendCoinsRecipient recipient
Definition: recentrequeststablemodel.h:27
Parse
std::unique_ptr< Descriptor > Parse(const std::string &descriptor, FlatSigningProvider &out, std::string &error, bool require_checksum)
Parse a descriptor string.
Definition: descriptor.cpp:1394
transactiontablemodel.h
MakeUCharSpan
constexpr auto MakeUCharSpan(V &&v) -> decltype(UCharSpanCast(Span
Like the Span constructor, but for (const) unsigned char member types only.
Definition: span.h:285
BasicTestingSetup::m_node
node::NodeContext m_node
Definition: setup_common.h:85
assert
assert(!tx.IsCoinBase())
ReceiveCoinsDialog
Dialog for requesting payment of bitcoins.
Definition: receivecoinsdialog.h:30
RecentRequestEntry::date
QDateTime date
Definition: recentrequeststablemodel.h:26
SER_DISK
@ SER_DISK
Definition: serialize.h:132
wallettests.h
wallet.h
wallet::AddWallet
bool AddWallet(WalletContext &context, const std::shared_ptr< CWallet > &wallet)
Definition: wallet.cpp:110
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:52
wallet::WalletRescanReserver
RAII object to check and reserve a wallet rescan.
Definition: wallet.h:902
BitcoinUnits::formatWithUnit
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
Definition: bitcoinunits.cpp:150
key_io.h
setup_common.h
sendcoinsdialog.h
walletmodel.h
SendCoinsRecipient::label
QString label
Definition: sendcoinsrecipient.h:32
RecentRequestsTableModel::rowCount
int rowCount(const QModelIndex &parent) const override
Definition: recentrequeststablemodel.cpp:42
wallet::WALLET_FLAG_DESCRIPTORS
@ WALLET_FLAG_DESCRIPTORS
Indicate that this wallet supports DescriptorScriptPubKeyMan.
Definition: walletutil.h:66
OverviewPage
Overview ("home") page widget.
Definition: overviewpage.h:28
SendCoinsRecipient::authenticatedMerchant
QString authenticatedMerchant
Definition: sendcoinsrecipient.h:40
wallet
Definition: node.h:38
GetDestinationForKey
CTxDestination GetDestinationForKey(const CPubKey &key, OutputType type)
Get a destination of the requested type (if possible) to the specified key.
Definition: outputtype.cpp:49
chain.h
Assert
#define Assert(val)
Identity function.
Definition: check.h:57
overviewpage.h
OptionsModel
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:38
ChangeType
ChangeType
General change type (added, updated, removed).
Definition: ui_change_type.h:9
CURRENCY_UNIT
const std::string CURRENCY_UNIT
Definition: feerate.h:14
WalletTests::walletTests
void walletTests()
Definition: wallettests.cpp:315
CTxDestination
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:157
EncodeSecret
std::string EncodeSecret(const CKey &key)
Definition: key_io.cpp:216
GetScriptForRawPubKey
CScript GetScriptForRawPubKey(const CPubKey &pubKey)
Generate a P2PK script for the given pubkey.
Definition: standard.cpp:315
sendcoinsentry.h
util.h
wallet::CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition: wallet.h:232
BitcoinAmountField::value
qint64 value
Definition: bitcoinamountfield.h:26
node.h
RecentRequestsTableModel
Model for list of recently generated payment requests / bitcoin: URIs.
Definition: recentrequeststablemodel.h:52
recentrequeststablemodel.h
RecentRequestEntry::nVersion
int nVersion
Definition: recentrequeststablemodel.h:24
TransactionTableModel::rowCount
int rowCount(const QModelIndex &parent) const override
Definition: transactiontablemodel.cpp:297
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
QValidatedLineEdit
Line edit that can be marked as "invalid" to show input validation feedback.
Definition: qvalidatedlineedit.h:13
context
WalletContext context
Definition: notifications.cpp:37
SendCoinsDialog
Dialog for sending bitcoins.
Definition: sendcoinsdialog.h:33
TestChain100Setup
Testing fixture that pre-creates a 100-block REGTEST-mode block chain.
Definition: setup_common.h:124
base_blob::ToString
std::string ToString() const
Definition: uint256.cpp:64
uint256
256-bit opaque blob.
Definition: uint256.h:126
CKey::GetPubKey
CPubKey GetPubKey() const
Compute the public key from a private key.
Definition: key.cpp:187
TestChain100Setup::CreateAndProcessBlock
CBlock CreateAndProcessBlock(const std::vector< CMutableTransaction > &txns, const CScript &scriptPubKey, CChainState *chainstate=nullptr)
Create a new block with just given transactions, coinbase paying to scriptPubKey, and try to add it t...
Definition: setup_common.cpp:291
ReceiveRequestDialog
Definition: receiverequestdialog.h:18
wallet::CreateMockWalletDatabase
std::unique_ptr< WalletDatabase > CreateMockWalletDatabase()
Return object for accessing temporary in-memory database.
Definition: walletdb.cpp:1190
gArgs
ArgsManager gArgs
Definition: system.cpp:80
PlatformStyle::instantiate
static const PlatformStyle * instantiate(const QString &platformId)
Get style associated with provided platform name, or 0 if not known.
Definition: platformstyle.cpp:124
interfaces::Node
Top-level interface for a bitcoin node (bitcoind process).
Definition: node.h:68
qvalidatedlineedit.h
node::NodeContext::args
ArgsManager * args
Definition: context.h:50
BitcoinUnits::SeparatorStyle::ALWAYS
@ ALWAYS
platformstyle.h
BitcoinAmountField::setValue
void setValue(const CAmount &value)
Definition: bitcoinamountfield.cpp:298
bitcoinamountfield.h
PKHash
Definition: standard.h:79
ClientModel
Model for Bitcoin network client.
Definition: clientmodel.h:47
TransactionTableModel
UI model for the transaction table of a wallet.
Definition: transactiontablemodel.h:26
receivecoinsdialog.h
RecentRequestEntry::id
int64_t id
Definition: recentrequeststablemodel.h:25
SendCoinsRecipient::sPaymentRequest
std::string sPaymentRequest
Definition: sendcoinsrecipient.h:38
LOCK
#define LOCK(cs)
Definition: sync.h:226
SendCoinsRecipient::address
QString address
Definition: sendcoinsrecipient.h:31
WalletTests::m_node
interfaces::Node & m_node
Definition: wallettests.h:19
CLIENT_VERSION
static const int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
Definition: clientversion.h:33
ConfirmMessage
void ConfirmMessage(QString *text, std::chrono::milliseconds msec)
Press "Ok" button in message box dialog.
Definition: util.cpp:14
SendCoinsDialog::setModel
void setModel(WalletModel *model)
Definition: sendcoinsdialog.cpp:149
Params
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:561
TransactionTableModel::TxHashRole
@ TxHashRole
Transaction hash.
Definition: transactiontablemodel.h:64
TestChain100Setup::coinbaseKey
CKey coinbaseKey
Definition: setup_common.h:168
node
Definition: init.h:22
CDataStream
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:184
transactionview.h
SendCoinsEntry
A single entry in the dialog for sending bitcoins.
Definition: sendcoinsentry.h:28
wallet::WalletDescriptor
Descriptor with some wallet metadata.
Definition: walletutil.h:76
node::NodeContext::wallet_loader
interfaces::WalletLoader * wallet_loader
Reference to chain client that should used to load or create wallets opened by the gui.
Definition: context.h:56
BitcoinAmountField
Widget for entering bitcoin amounts.
Definition: bitcoinamountfield.h:20
interfaces::MakeWallet
std::unique_ptr< Wallet > MakeWallet(wallet::WalletContext &context, const std::shared_ptr< wallet::CWallet > &wallet)
Return implementation of Wallet interface.
Definition: interfaces.cpp:600
wallet::WalletContext
WalletContext struct containing references to state shared between CWallet instances,...
Definition: context.h:35
optionsmodel.h
error
bool error(const char *fmt, const Args &... args)
Definition: system.h:49
COIN
static constexpr CAmount COIN
The amount of satoshis in one BTC.
Definition: amount.h:15
interfaces::MakeWalletLoader
std::unique_ptr< WalletLoader > MakeWalletLoader(Chain &chain, ArgsManager &args)
Return implementation of ChainClient interface for a wallet loader.
Definition: dummywallet.cpp:61
wallet::RemoveWallet
bool RemoveWallet(WalletContext &context, const std::shared_ptr< CWallet > &wallet, std::optional< bool > load_on_start, std::vector< bilingual_str > &warnings)
Definition: wallet.cpp:122
receiverequestdialog.h
EncodeDestination
std::string EncodeDestination(const CTxDestination &dest)
Definition: key_io.cpp:276
FlatSigningProvider
Definition: signingprovider.h:72
clientmodel.h
node::NodeContext::chain
std::unique_ptr< interfaces::Chain > chain
Definition: context.h:51
RecentRequestEntry
Definition: recentrequeststablemodel.h:18
SendCoinsRecipient::message
QString message
Definition: sendcoinsrecipient.h:35