mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
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:
@ -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)?;
|
||||
|
||||
Reference in New Issue
Block a user