Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/wallettests.cpp
#include <qt/test/util.h> | #include <qt/test/util.h> | ||||
#include <qt/test/wallettests.h> | #include <qt/test/wallettests.h> | ||||
#include <base58.h> | #include <base58.h> | ||||
#include <cashaddrenc.h> | #include <cashaddrenc.h> | ||||
#include <chain.h> | #include <chain.h> | ||||
#include <chainparams.h> | #include <chainparams.h> | ||||
#include <interfaces/chain.h> | |||||
#include <interfaces/node.h> | #include <interfaces/node.h> | ||||
#include <key_io.h> | #include <key_io.h> | ||||
#include <qt/bitcoinamountfield.h> | #include <qt/bitcoinamountfield.h> | ||||
#include <qt/optionsmodel.h> | #include <qt/optionsmodel.h> | ||||
#include <qt/overviewpage.h> | #include <qt/overviewpage.h> | ||||
#include <qt/platformstyle.h> | #include <qt/platformstyle.h> | ||||
#include <qt/qvalidatedlineedit.h> | #include <qt/qvalidatedlineedit.h> | ||||
#include <qt/receivecoinsdialog.h> | #include <qt/receivecoinsdialog.h> | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
// src/qt/test/test_bitcoin-qt -platform cocoa # macOS | // src/qt/test/test_bitcoin-qt -platform cocoa # macOS | ||||
void TestGUI() { | void TestGUI() { | ||||
// Set up wallet and chain with 105 blocks (5 mature blocks for spending). | // Set up wallet and chain with 105 blocks (5 mature blocks for spending). | ||||
TestChain100Setup test; | TestChain100Setup test; | ||||
for (int i = 0; i < 5; ++i) { | for (int i = 0; i < 5; ++i) { | ||||
test.CreateAndProcessBlock( | test.CreateAndProcessBlock( | ||||
{}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); | {}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); | ||||
} | } | ||||
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); | ||||
{ | { | ||||
LOCK(wallet->cs_wallet); | LOCK(wallet->cs_wallet); | ||||
wallet->SetAddressBook( | wallet->SetAddressBook( | ||||
GetDestinationForKey(test.coinbaseKey.GetPubKey(), | GetDestinationForKey(test.coinbaseKey.GetPubKey(), | ||||
wallet->m_default_address_type), | wallet->m_default_address_type), | ||||
"", "receive"); | "", "receive"); | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |