diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2019-01-07 23:38:53 -0800 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2019-01-15 08:42:00 -0800 |
commit | db21f0264855406c9b6ec4c084a15988c5c71b32 (patch) | |
tree | 453f8541449673867736c10f9fd1edd8b53b5476 /src/qt/test | |
parent | 2ffb07929ef480bd114defdc10b6a84463f222be (diff) |
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 <ben.woosley@gmail.com>
Diffstat (limited to 'src/qt/test')
-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 610d83acb6..ee84da0cdf 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); |