From c7a837d6dcabaaa2789eda986628e7506dcf2fc7 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Tue, 11 Nov 2025 20:32:34 +0100 Subject: [PATCH] feat: add Bloom::accrue_logs method Adds convenience method to ingest multiple logs into a bloom filter at once, complementing the existing accrue_log method. Co-Authored-By: Claude --- crates/primitives/src/bits/bloom.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/primitives/src/bits/bloom.rs b/crates/primitives/src/bits/bloom.rs index 6a35a9a5e..037c8e921 100644 --- a/crates/primitives/src/bits/bloom.rs +++ b/crates/primitives/src/bits/bloom.rs @@ -202,6 +202,13 @@ impl Bloom { self.accrue_raw_log(log.address, log.topics()) } + /// Ingests multiple logs into the bloom filter. + pub fn accrue_logs(&mut self, logs: &[Log]) { + for log in logs { + self.accrue_log(log) + } + } + /// True if the bloom filter contains a log with given address and topics. /// /// Note: This method may return false positives. This is inherent to the