diff options
| author | Russell Yanofsky <[email protected]> | 2019-01-07 23:38:53 -0800 |
|---|---|---|
| committer | Russell Yanofsky <[email protected]> | 2019-01-15 08:42:00 -0800 |
| commit | db21f0264855406c9b6ec4c084a15988c5c71b32 (patch) | |
| tree | 453f8541449673867736c10f9fd1edd8b53b5476 /src/qt/test/wallettests.cpp | |
| parent | Add findFork and findBlock to the Chain interface (diff) | |
| download | discoin-db21f0264855406c9b6ec4c084a15988c5c71b32.tar.xz discoin-db21f0264855406c9b6ec4c084a15988c5c71b32.zip | |
Convert CWallet::ScanForWalletTransactions and SyncTransaction to the new Chain apis
Only change in behavior is "Rescan started from block <height>" message
replaced by "Rescan started from block <hash>" message in
ScanForWalletTransactions.
Co-authored-by: Ben Woosley <[email protected]>
Diffstat (limited to 'src/qt/test/wallettests.cpp')
| -rw-r--r-- | src/qt/test/wallettests.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qt/test/wallettests.cpp b/src/qt/test/wallettests.cpp index 610d83acb..ee84da0cd 100644 --- a/src/qt/test/wallettests.cpp +++ b/src/qt/test/wallettests.cpp @@ -1,6 +1,7 @@ #include <qt/test/wallettests.h> #include <qt/test/util.h> +#include <init.h> #include <interfaces/chain.h> #include <interfaces/node.h> #include <base58.h> @@ -146,13 +147,10 @@ void TestGUI() auto locked_chain = wallet->chain().lock(); WalletRescanReserver reserver(wallet.get()); reserver.reserve(); - const CBlockIndex* const null_block = nullptr; - const CBlockIndex *stop_block, *failed_block; - QCOMPARE( - wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, failed_block, stop_block, true /* fUpdate */), - CWallet::ScanResult::SUCCESS); - QCOMPARE(stop_block, chainActive.Tip()); - QCOMPARE(failed_block, null_block); + CWallet::ScanResult result = wallet->ScanForWalletTransactions(locked_chain->getBlockHash(0), {} /* stop_block */, reserver, true /* fUpdate */); + QCOMPARE(result.status, CWallet::ScanResult::SUCCESS); + QCOMPARE(result.stop_block, chainActive.Tip()->GetBlockHash()); + QVERIFY(result.failed_block.IsNull()); } wallet->SetBroadcastTransactions(true); |