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/test_bitcoin.h> | #include <test/test_bitcoin.h> | ||||
#include <interfaces/chain.h> | |||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <qt/addressbookpage.h> | #include <qt/addressbookpage.h> | ||||
#include <qt/addresstablemodel.h> | #include <qt/addresstablemodel.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> | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
* - existing_r_address: an existing receiving address which won't add | * - existing_r_address: an existing receiving address which won't add | ||||
* successfully. | * successfully. | ||||
* | * | ||||
* In each case, verify the resulting state of the address book and optionally | * In each case, verify the resulting state of the address book and optionally | ||||
* the warning message presented to the user. | * the warning message presented to the user. | ||||
*/ | */ | ||||
void TestAddAddressesToSendBook() { | void TestAddAddressesToSendBook() { | ||||
TestChain100Setup test; | TestChain100Setup test; | ||||
auto chain = interfaces::MakeChain(); | |||||
std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>( | std::shared_ptr<CWallet> wallet = std::make_shared<CWallet>( | ||||
Params(), WalletLocation(), WalletDatabase::CreateMock()); | Params(), *chain, WalletLocation(), WalletDatabase::CreateMock()); | ||||
bool firstRun; | bool firstRun; | ||||
wallet->LoadWallet(firstRun); | wallet->LoadWallet(firstRun); | ||||
auto build_address = [&wallet]() { | auto build_address = [&wallet]() { | ||||
CKey key; | CKey key; | ||||
key.MakeNewKey(true); | key.MakeNewKey(true); | ||||
CTxDestination dest(GetDestinationForKey( | CTxDestination dest(GetDestinationForKey( | ||||
key.GetPubKey(), wallet->m_default_address_type)); | key.GetPubKey(), wallet->m_default_address_type)); | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |