Changeset View
Changeset View
Standalone View
Standalone View
src/qt/test/wallettests.cpp
| #include "wallettests.h" | #include "wallettests.h" | ||||
| #include "chainparams.h" | |||||
| #include "dstencode.h" | #include "dstencode.h" | ||||
| #include "qt/bitcoinamountfield.h" | #include "qt/bitcoinamountfield.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/sendcoinsdialog.h" | #include "qt/sendcoinsdialog.h" | ||||
| #include "qt/sendcoinsentry.h" | #include "qt/sendcoinsentry.h" | ||||
| #include "qt/transactiontablemodel.h" | #include "qt/transactiontablemodel.h" | ||||
| ▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
| void WalletTests::walletTests() { | void WalletTests::walletTests() { | ||||
| // Set up wallet and chain with 101 blocks (1 mature block for spending). | // Set up wallet and chain with 101 blocks (1 mature block for spending). | ||||
| TestChain100Setup test; | TestChain100Setup test; | ||||
| test.CreateAndProcessBlock( | test.CreateAndProcessBlock( | ||||
| {}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); | {}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey())); | ||||
| bitdb.MakeMock(); | bitdb.MakeMock(); | ||||
| std::unique_ptr<CWalletDBWrapper> dbw( | std::unique_ptr<CWalletDBWrapper> dbw( | ||||
| new CWalletDBWrapper(&bitdb, "wallet_test.dat")); | new CWalletDBWrapper(&bitdb, "wallet_test.dat")); | ||||
| CWallet wallet(std::move(dbw)); | CWallet wallet(Params(), std::move(dbw)); | ||||
| bool firstRun; | bool firstRun; | ||||
| wallet.LoadWallet(firstRun); | wallet.LoadWallet(firstRun); | ||||
| { | { | ||||
| LOCK(wallet.cs_wallet); | LOCK(wallet.cs_wallet); | ||||
| wallet.SetAddressBook(test.coinbaseKey.GetPubKey().GetID(), "", | wallet.SetAddressBook(test.coinbaseKey.GetPubKey().GetID(), "", | ||||
| "receive"); | "receive"); | ||||
| wallet.AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | wallet.AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey()); | ||||
| } | } | ||||
| Show All 29 Lines | |||||