mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-29 17:18:08 -05:00
chore: add PostState::logs_bloom (#2191)
This commit is contained in:
@@ -7,7 +7,8 @@ use reth_db::{
|
||||
Error as DbError,
|
||||
};
|
||||
use reth_primitives::{
|
||||
Account, Address, Bytecode, Receipt, StorageEntry, TransitionId, H256, U256,
|
||||
bloom::logs_bloom, Account, Address, Bloom, Bytecode, Log, Receipt, StorageEntry, TransitionId,
|
||||
H256, U256,
|
||||
};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -262,6 +263,16 @@ impl PostState {
|
||||
&self.receipts
|
||||
}
|
||||
|
||||
/// Returns an iterator over all logs in this [PostState].
|
||||
pub fn logs(&self) -> impl Iterator<Item = &Log> + '_ {
|
||||
self.receipts().iter().flat_map(|r| r.logs.iter())
|
||||
}
|
||||
|
||||
/// Returns the logs bloom for all recorded logs.
|
||||
pub fn logs_bloom(&self) -> Bloom {
|
||||
logs_bloom(self.logs())
|
||||
}
|
||||
|
||||
/// Get the number of transitions causing this [PostState]
|
||||
pub fn transitions_count(&self) -> TransitionId {
|
||||
self.current_transition_id
|
||||
|
||||
Reference in New Issue
Block a user