mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
feat(execution-types): add receipts_iter helper (#21162)
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -249,6 +249,14 @@ impl<T> ExecutionOutcome<T> {
|
||||
&self.receipts[index]
|
||||
}
|
||||
|
||||
/// Returns an iterator over receipt slices, one per block.
|
||||
///
|
||||
/// This is a more ergonomic alternative to `receipts()` that yields slices
|
||||
/// instead of requiring indexing into a nested `Vec<Vec<T>>`.
|
||||
pub fn receipts_iter(&self) -> impl Iterator<Item = &[T]> + '_ {
|
||||
self.receipts.iter().map(|v| v.as_slice())
|
||||
}
|
||||
|
||||
/// Is execution outcome empty.
|
||||
pub const fn is_empty(&self) -> bool {
|
||||
self.len() == 0
|
||||
|
||||
Reference in New Issue
Block a user