mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: introduce maybe_pending method to StateProviderFactory (#18260)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -557,6 +557,10 @@ impl<C: Send + Sync + 'static, N: NodePrimitives> StateProviderFactory for NoopP
|
||||
fn pending_state_by_hash(&self, _block_hash: B256) -> ProviderResult<Option<StateProviderBox>> {
|
||||
Ok(Some(Box::new(self.clone())))
|
||||
}
|
||||
|
||||
fn maybe_pending(&self) -> ProviderResult<Option<StateProviderBox>> {
|
||||
Ok(Some(Box::new(self.clone())))
|
||||
}
|
||||
}
|
||||
|
||||
impl<C: Send + Sync, N: NodePrimitives> StageCheckpointReader for NoopProvider<C, N> {
|
||||
|
||||
@@ -194,4 +194,9 @@ pub trait StateProviderFactory: BlockIdReader + Send + Sync {
|
||||
///
|
||||
/// If the block couldn't be found, returns `None`.
|
||||
fn pending_state_by_hash(&self, block_hash: B256) -> ProviderResult<Option<StateProviderBox>>;
|
||||
|
||||
/// Returns a pending [`StateProvider`] if it exists.
|
||||
///
|
||||
/// This will return `None` if there's no pending state.
|
||||
fn maybe_pending(&self) -> ProviderResult<Option<StateProviderBox>>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user