mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: dont panic on unsupported tag (#2578)
This commit is contained in:
@ -92,4 +92,9 @@ pub enum ProviderError {
|
||||
/// Unable to compute state root on top of historical block
|
||||
#[error("Unable to compute state root on top of historical block")]
|
||||
StateRootNotAvailableForHistoricalBlock,
|
||||
|
||||
#[error("Safe tag currently unsupported")]
|
||||
SafeTagUnsupported,
|
||||
#[error("Finalized tag currently unsupported")]
|
||||
FinalizedTagUnsupported,
|
||||
}
|
||||
|
||||
@ -115,12 +115,8 @@ pub trait StateProviderFactory: Send + Sync {
|
||||
) -> Result<StateProviderBox<'_>> {
|
||||
match number_or_tag {
|
||||
BlockNumberOrTag::Latest => self.latest(),
|
||||
BlockNumberOrTag::Finalized => {
|
||||
todo!()
|
||||
}
|
||||
BlockNumberOrTag::Safe => {
|
||||
todo!()
|
||||
}
|
||||
BlockNumberOrTag::Finalized => Err(ProviderError::FinalizedTagUnsupported.into()),
|
||||
BlockNumberOrTag::Safe => Err(ProviderError::SafeTagUnsupported.into()),
|
||||
BlockNumberOrTag::Earliest => self.history_by_block_number(0),
|
||||
BlockNumberOrTag::Pending => self.pending(),
|
||||
BlockNumberOrTag::Number(num) => self.history_by_block_number(num),
|
||||
|
||||
Reference in New Issue
Block a user