Skip to content

Commit d0872de

Browse files
prestwichmattsse
authored andcommitted
refactor: improve and simplify event filters (alloy-rs#2140)
* refactor: improve and simplify event filters * docs: minor fixes * feat: mutable filter access with unsealing * fix: cfg_attr * touchup * fix: test * fix: preserve deserialize behavior * fix: matches_log_block and type of rpc_matches_parsed * fix: don't disregard address bloom --------- Co-authored-by: Matthias Seitz <[email protected]>
1 parent b32150b commit d0872de

File tree

9 files changed

+332
-264
lines changed

9 files changed

+332
-264
lines changed

crates/consensus/src/receipt/receipts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ impl<T> Receipt<T>
4040
where
4141
T: AsRef<Log>,
4242
{
43-
/// Calculates [`Log`]'s bloom filter. this is slow operation and [ReceiptWithBloom] can
44-
/// be used to cache this value.
43+
/// Calculates [`Log`]'s bloom filter. This is slow operation and
44+
/// [`ReceiptWithBloom`] can be used to cache this value.
4545
pub fn bloom_slow(&self) -> Bloom {
4646
self.logs.iter().map(AsRef::as_ref).collect()
4747
}
4848

49-
/// Calculates the bloom filter for the receipt and returns the [ReceiptWithBloom] container
50-
/// type.
49+
/// Calculates the bloom filter for the receipt and returns the
50+
/// [`ReceiptWithBloom`] container type.
5151
pub fn with_bloom(self) -> ReceiptWithBloom<Self> {
5252
ReceiptWithBloom { logs_bloom: self.bloom_slow(), receipt: self }
5353
}

crates/rpc-types-eth/src/block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ mod tests {
12091209

12101210
// <https://github.com/succinctlabs/kona/issues/31>
12111211
#[test]
1212+
#[cfg(feature = "serde")]
12121213
fn deserde_tenderly_block() {
12131214
let s = include_str!("../testdata/tenderly.sepolia.json");
12141215
let _block: Block = serde_json::from_str(s).unwrap();

crates/rpc-types-eth/src/fee.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ mod tests {
151151
}
152152

153153
#[test]
154+
#[cfg(feature = "serde")]
154155
fn test_fee_hist_null_gas_used_ratio() {
155156
let json = r#"{"oldestBlock": "0x0", "gasUsedRatio": null}"#;
156157
let _actual = serde_json::from_str::<FeeHistory>(json).unwrap();

0 commit comments

Comments
 (0)