Skip to content

Commit

Permalink
KeyChainGroupTest: fix spurious test failure of `bloomFilterForMarrie…
Browse files Browse the repository at this point in the history
…dChains()`

This was caused by expected bloom filter false positives.

This is a backport of c205c67.
  • Loading branch information
schildbach committed Jun 24, 2024
1 parent 12af8b9 commit e68a0d0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ public void bloomFilterForMarriedChains() throws Exception {
assertTrue("key " + i, filter.contains(address.getHash()));
}
// We ran ahead of the lookahead buffer.
assertFalse(filter.contains(group.freshAddress(KeyChain.KeyPurpose.RECEIVE_FUNDS).getHash()));
// We try two fresh addresses because of expected false positives. Note that the test could still fail.
Address fresh1 = group.freshAddress(KeyPurpose.RECEIVE_FUNDS);
Address fresh2 = group.freshAddress(KeyPurpose.RECEIVE_FUNDS);
assertFalse(filter.contains(fresh1.getHash()) && filter.contains(fresh2.getHash()));
}

@Test
Expand Down

0 comments on commit e68a0d0

Please sign in to comment.