Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/addressbooktests.cpp
#include <qt/test/addressbooktests.h> | #include <qt/test/addressbooktests.h> | ||||
#include <test/util/setup_common.h> | #include <test/util/setup_common.h> | ||||
#include <interfaces/chain.h> | #include <interfaces/chain.h> | ||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <qt/clientmodel.h> | |||||
#include <qt/editaddressdialog.h> | #include <qt/editaddressdialog.h> | ||||
#include <qt/optionsmodel.h> | #include <qt/optionsmodel.h> | ||||
#include <qt/platformstyle.h> | #include <qt/platformstyle.h> | ||||
#include <qt/qvalidatedlineedit.h> | #include <qt/qvalidatedlineedit.h> | ||||
#include <qt/test/util.h> | #include <qt/test/util.h> | ||||
#include <qt/walletmodel.h> | #include <qt/walletmodel.h> | ||||
#include <cashaddrenc.h> | #include <cashaddrenc.h> | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void TestAddAddressesToSendBook(interfaces::Node &node) { | ||||
// We should start with the two addresses we added earlier and nothing else. | // We should start with the two addresses we added earlier and nothing else. | ||||
check_addbook_size(2); | check_addbook_size(2); | ||||
// Initialize relevant QT models. | // Initialize relevant QT models. | ||||
std::unique_ptr<const PlatformStyle> platformStyle( | std::unique_ptr<const PlatformStyle> platformStyle( | ||||
PlatformStyle::instantiate("other")); | PlatformStyle::instantiate("other")); | ||||
OptionsModel optionsModel; | OptionsModel optionsModel; | ||||
ClientModel clientModel(node, &optionsModel); | |||||
AddWallet(wallet); | AddWallet(wallet); | ||||
WalletModel walletModel(interfaces::MakeWallet(wallet), node, | WalletModel walletModel(interfaces::MakeWallet(wallet), clientModel, | ||||
platformStyle.get(), &optionsModel); | platformStyle.get()); | ||||
RemoveWallet(wallet); | RemoveWallet(wallet); | ||||
EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress); | EditAddressDialog editAddressDialog(EditAddressDialog::NewSendingAddress); | ||||
editAddressDialog.setModel(walletModel.getAddressTableModel()); | editAddressDialog.setModel(walletModel.getAddressTableModel()); | ||||
EditAddressAndSubmit( | EditAddressAndSubmit( | ||||
&editAddressDialog, QString("uhoh"), preexisting_r_address, | &editAddressDialog, QString("uhoh"), preexisting_r_address, | ||||
QString( | QString( | ||||
"Address \"%1\" already exists as a receiving address with label " | "Address \"%1\" already exists as a receiving address with label " | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |