Skip to content

Commit 52a263d

Browse files
mattsseclaude
andauthored
feat: add Bloom::accrue_logs method (#1039)
Adds convenience method to ingest multiple logs into a bloom filter at once, complementing the existing accrue_log method. Co-authored-by: Claude <[email protected]>
1 parent 8dce67e commit 52a263d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/primitives/src/bits/bloom.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ impl Bloom {
202202
self.accrue_raw_log(log.address, log.topics())
203203
}
204204

205+
/// Ingests multiple logs into the bloom filter.
206+
pub fn accrue_logs(&mut self, logs: &[Log]) {
207+
for log in logs {
208+
self.accrue_log(log)
209+
}
210+
}
211+
205212
/// True if the bloom filter contains a log with given address and topics.
206213
///
207214
/// Note: This method may return false positives. This is inherent to the

0 commit comments

Comments
 (0)