Skip to content

Commit

Permalink
Fix FilteredBlockstore.has (I'm a clown)
Browse files Browse the repository at this point in the history
Add a test for it too.
  • Loading branch information
ianopolous committed Sep 30, 2024
1 parent c359692 commit d9018ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public CompletableFuture<Boolean> has(Cid c) {
return blocks.has(c).thenApply(res -> {
if (! res)
addAbsentBlock(c);
return false;
return res;
});
return CompletableFuture.completedFuture(false);
}
Expand Down
4 changes: 4 additions & 0 deletions src/test/java/org/peergos/blockstore/BloomTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public void bloom() {
long t4 = System.currentTimeMillis();
System.out.println("Doubling filter size took: " + (t4-t3)+ "ms");

for (Cid ref : bs.refs(false).join()) {
Assert.assertTrue(filtered.has(ref).join());
}

checkFalsePositiveRate(bloom, 14);
}

Expand Down

0 comments on commit d9018ae

Please sign in to comment.