Skip to content

Commit

Permalink
Fix fuzz
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Mar 15, 2024
1 parent 070b427 commit 39f35d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rust-bindings/fuzz/fuzz_targets/fuzz_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use chiabip158::Bip158Filter;
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: Vec<&[u8]>| {
if data.is_empty() {
return;
}

let filter = Bip158Filter::new(&data);

let encoded = filter.encode();
Expand All @@ -12,6 +16,8 @@ fuzz_target!(|data: Vec<&[u8]>| {
let _ = *byte;
}

assert!(filter.matches_any(&data));

for elem in data {
assert!(filter.matches(elem));
}
Expand Down

0 comments on commit 39f35d9

Please sign in to comment.