mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: abstract over Evm::Error (#14085)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -18,8 +18,6 @@ reth-errors.workspace = true
|
||||
reth-primitives.workspace = true
|
||||
reth-chain-state.workspace = true
|
||||
|
||||
revm-primitives.workspace = true
|
||||
|
||||
# alloy
|
||||
alloy-eips.workspace = true
|
||||
alloy-primitives.workspace = true
|
||||
@ -39,7 +37,6 @@ default = ["std"]
|
||||
std = [
|
||||
"reth-chainspec/std",
|
||||
"reth-primitives/std",
|
||||
"revm-primitives/std",
|
||||
"alloy-eips/std",
|
||||
"alloy-primitives/std",
|
||||
"alloy-rpc-types-engine/std",
|
||||
|
||||
@ -4,7 +4,6 @@ use alloc::boxed::Box;
|
||||
use alloy_primitives::B256;
|
||||
use alloy_rpc_types_engine::ForkchoiceUpdateError;
|
||||
use reth_errors::{ProviderError, RethError};
|
||||
use revm_primitives::EVMError;
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
/// Possible error variants during payload building.
|
||||
@ -27,13 +26,21 @@ pub enum PayloadBuilderError {
|
||||
Internal(#[from] RethError),
|
||||
/// Unrecoverable error during evm execution.
|
||||
#[error("evm execution error: {0}")]
|
||||
EvmExecutionError(EVMError<ProviderError>),
|
||||
EvmExecutionError(Box<dyn core::error::Error + Send + Sync>),
|
||||
/// Any other payload building errors.
|
||||
#[error(transparent)]
|
||||
Other(Box<dyn core::error::Error + Send + Sync>),
|
||||
}
|
||||
|
||||
impl PayloadBuilderError {
|
||||
/// Create a new EVM error from a boxed error.
|
||||
pub fn evm<E>(error: E) -> Self
|
||||
where
|
||||
E: core::error::Error + Send + Sync + 'static,
|
||||
{
|
||||
Self::EvmExecutionError(Box::new(error))
|
||||
}
|
||||
|
||||
/// Create a new error from a boxed error.
|
||||
pub fn other<E>(error: E) -> Self
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user