Skip to content

Commit 856f65c

Browse files
committed
fix: advance last_processed_height in NonMatchingMockWallet
The mock's `process_block_for_wallets` was a no-op, diverging from the real `WalletManager` contract that advances the per-wallet checkpoint for every selected wallet regardless of transaction matches. Sync tests against the mock could pass while production would advance checkpoints. Mirror the contract for selected wallets. Addresses CodeRabbit review comment on PR #694 #694 (comment)
1 parent fa9cc19 commit 856f65c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

key-wallet-manager/src/test_utils/mock_wallet.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,12 @@ impl WalletInterface for NonMatchingMockWallet {
285285
async fn process_block_for_wallets(
286286
&mut self,
287287
_block: &Block,
288-
_height: u32,
289-
_wallets: &BTreeSet<WalletId>,
288+
height: u32,
289+
wallets: &BTreeSet<WalletId>,
290290
) -> BlockProcessingResult {
291+
if wallets.contains(&self.wallet_id) && height > self.last_processed_height {
292+
self.last_processed_height = height;
293+
}
291294
BlockProcessingResult::default()
292295
}
293296

0 commit comments

Comments
 (0)