-
Currently, I am doing the following: fn get_logs(&self, block_number: u64) -> Result<Option<Vec<Log>>, ProviderError> {
// get receipts by block from the DB
let receipts = self.f.receipts_by_block(block_number.into())?;
// collect all logs into single vec
let logs = receipts.map(|recs| {
recs.iter()
.filter_map(|rec| {
if rec.status() {
let logs = rec.logs();
Some(logs.to_vec())
} else {
None
}
})
.flatten()
.collect::<Vec<Log>>()
});
Ok(logs)
} This results in Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
mattsse
Jul 3, 2025
Replies: 1 comment 1 reply
-
the logic isn't super complex, it's just a bunch of conversions and checks for certain fields, you only need the transactions as well, see reth/crates/rpc/rpc/src/eth/helpers/block.rs Lines 40 to 69 in 037be8d |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mattsse
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the logic isn't super complex, it's just a bunch of conversions and checks for certain fields,
you only need the transactions as well, see
reth/crates/rpc/rpc/src/eth/helpers/block.rs
Lines 40 to 69 in 037be8d