@@ -351,8 +351,8 @@ BOOST_AUTO_TEST_CASE(SaplingNullifierIsSpent) {
351351 BOOST_CHECK (chainActive.Contains (&fakeIndex));
352352 BOOST_CHECK_EQUAL (0 , chainActive.Height ());
353353
354- wtx. m_confirm = CWalletTx::Confirmation (CWalletTx::Status::CONFIRMED, 0 , block. GetHash (), 0 ) ;
355- wallet.LoadToWallet (wtx );
354+ std::vector<CTransactionRef> vtxConflicted ;
355+ wallet.BlockConnected (std::make_shared<CBlock>(block), mi-> second , vtxConflicted );
356356
357357 // Verify note has been spent
358358 BOOST_CHECK (wallet.GetSaplingScriptPubKeyMan ()->IsSaplingSpent (nullifier));
@@ -421,6 +421,7 @@ BOOST_AUTO_TEST_CASE(NavigateFromSaplingNullifierToNote) {
421421 wallet.LoadToWallet (wtx);
422422
423423 // Verify dummy note is now spent, as AddToWallet invokes AddToSpends()
424+ wallet.SetLastBlockProcessed (mi->second );
424425 BOOST_CHECK (wallet.GetSaplingScriptPubKeyMan ()->IsSaplingSpent (nullifier));
425426
426427 // Test invariant: no witnesses means no nullifier.
@@ -520,6 +521,7 @@ BOOST_AUTO_TEST_CASE(SpentSaplingNoteIsFromMe) {
520521 // in the output descriptions of wtx.
521522 wallet.IncrementNoteWitnesses (&fakeIndex, &block, saplingTree);
522523 wallet.GetSaplingScriptPubKeyMan ()->UpdateSaplingNullifierNoteMapForBlock (&block);
524+ wallet.SetLastBlockProcessed (mi->second );
523525
524526 // Retrieve the updated wtx from wallet
525527 wtx = wallet.mapWallet .at (wtx.GetHash ());
@@ -590,6 +592,7 @@ BOOST_AUTO_TEST_CASE(SpentSaplingNoteIsFromMe) {
590592 wtx2.SetSaplingNoteData (saplingNoteData2);
591593 wtx2.m_confirm = CWalletTx::Confirmation (CWalletTx::Status::CONFIRMED, fakeIndex2.nHeight , block2.GetHash (), 0 );
592594 wallet.LoadToWallet (wtx2);
595+ wallet.SetLastBlockProcessed (mi2->second );
593596
594597 // Verify note B is spent. AddToWallet invokes AddToSpends which updates mapTxSaplingNullifiers
595598 BOOST_CHECK (wallet.GetSaplingScriptPubKeyMan ()->IsSaplingSpent (nullifier2));
0 commit comments