qt/test: Use existing chainman in ::TestGUI (can be scripted-diff)
This commit is contained in:
1 parent
6c15de129c
commit
f323248aba
1 file changed
+2
-2
@@ -146,14 +146,14 @@ void TestGUI(interfaces::Node& node)
|
|||||||
LOCK2(wallet->cs_wallet, spk_man->cs_KeyStore);
|
LOCK2(wallet->cs_wallet, spk_man->cs_KeyStore);
|
||||||
wallet->SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type), "", "receive");
|
wallet->SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), wallet->m_default_address_type), "", "receive");
|
||||||
spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
|
spk_man->AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());
|
||||||
wallet->SetLastBlockProcessed(105, ::ChainActive().Tip()->GetBlockHash());
|
wallet->SetLastBlockProcessed(105, node.context()->chainman->ActiveChain().Tip()->GetBlockHash());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
WalletRescanReserver reserver(*wallet);
|
WalletRescanReserver reserver(*wallet);
|
||||||
reserver.reserve();
|
reserver.reserve();
|
||||||
CWallet::ScanResult result = wallet->ScanForWalletTransactions(Params().GetConsensus().hashGenesisBlock, 0 /* block height */, {} /* max height */, reserver, true /* fUpdate */);
|
CWallet::ScanResult result = wallet->ScanForWalletTransactions(Params().GetConsensus().hashGenesisBlock, 0 /* block height */, {} /* max height */, reserver, true /* fUpdate */);
|
||||||
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
|
QCOMPARE(result.status, CWallet::ScanResult::SUCCESS);
|
||||||
QCOMPARE(result.last_scanned_block, ::ChainActive().Tip()->GetBlockHash());
|
QCOMPARE(result.last_scanned_block, node.context()->chainman->ActiveChain().Tip()->GetBlockHash());
|
||||||
QVERIFY(result.last_failed_block.IsNull());
|
QVERIFY(result.last_failed_block.IsNull());
|
||||||
}
|
}
|
||||||
wallet->SetBroadcastTransactions(true);
|
wallet->SetBroadcastTransactions(true);
|
||||||
|
|||||||
Reference in new issue
Block a user