feat(examples): OP Stack bridge stats ExEx (#7556)

Co-authored-by: Oliver Nordbjerg <hi@notbjerg.me>
Co-authored-by: Oliver Nordbjerg <onbjerg@users.noreply.github.com>
This commit is contained in:
Alexey Shekhirin
2024-04-11 17:38:03 +01:00
committed by GitHub
parent 007e5c2c47
commit 3ffc729833
9 changed files with 1019 additions and 7 deletions

View File

@ -8,7 +8,7 @@ use reth_primitives::{
};
use reth_trie::updates::TrieUpdates;
use revm::db::BundleState;
use std::{borrow::Cow, collections::BTreeMap, fmt};
use std::{borrow::Cow, collections::BTreeMap, fmt, ops::RangeInclusive};
/// A chain of blocks and their final state.
///
@ -177,6 +177,11 @@ impl Chain {
self.blocks.len()
}
/// Returns the range of block numbers in the chain.
pub fn range(&self) -> RangeInclusive<BlockNumber> {
self.first().number..=self.tip().number
}
/// Get all receipts for the given block.
pub fn receipts_by_block_hash(&self, block_hash: BlockHash) -> Option<Vec<&Receipt>> {
let num = self.block_number(block_hash)?;