mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add blockexecution msg fn (#8478)
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
use reth_consensus::ConsensusError;
|
||||
use reth_primitives::{revm_primitives::EVMError, BlockNumHash, PruneSegmentError, B256};
|
||||
use reth_storage_errors::provider::ProviderError;
|
||||
use std::fmt::Display;
|
||||
use thiserror::Error;
|
||||
|
||||
pub mod trie;
|
||||
@ -118,7 +119,7 @@ pub enum BlockExecutionError {
|
||||
/// Error when fetching latest block state.
|
||||
#[error(transparent)]
|
||||
LatestBlock(#[from] ProviderError),
|
||||
/// Optimism Block Executor Errors
|
||||
/// Arbitrary Block Executor Errors
|
||||
#[error(transparent)]
|
||||
Other(Box<dyn std::error::Error + Send + Sync>),
|
||||
}
|
||||
@ -132,6 +133,11 @@ impl BlockExecutionError {
|
||||
Self::Other(Box::new(error))
|
||||
}
|
||||
|
||||
/// Create a new [BlockExecutionError::Other] from a given message.
|
||||
pub fn msg(msg: impl Display) -> Self {
|
||||
Self::Other(msg.to_string().into())
|
||||
}
|
||||
|
||||
/// Returns the inner `BlockValidationError` if the error is a validation error.
|
||||
pub const fn as_validation(&self) -> Option<&BlockValidationError> {
|
||||
match self {
|
||||
|
||||
Reference in New Issue
Block a user