diff --git a/Cargo.lock b/Cargo.lock index d402a96b58c61..6c1e6122028df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8635,7 +8635,6 @@ dependencies = [ "reth-primitives", "reth-provider", "reth-rpc-api", - "reth-rpc-types", "reth-rpc-types-compat", "reth-storage-api", "reth-tasks", diff --git a/crates/rpc/rpc-engine-api/Cargo.toml b/crates/rpc/rpc-engine-api/Cargo.toml index 2e5ec0af8ce54..4463d375a0345 100644 --- a/crates/rpc/rpc-engine-api/Cargo.toml +++ b/crates/rpc/rpc-engine-api/Cargo.toml @@ -16,7 +16,6 @@ workspace = true reth-chainspec.workspace = true reth-primitives.workspace = true reth-rpc-api.workspace = true -reth-rpc-types.workspace = true reth-storage-api.workspace = true reth-beacon-consensus.workspace = true reth-payload-builder.workspace = true diff --git a/crates/rpc/rpc-engine-api/src/error.rs b/crates/rpc/rpc-engine-api/src/error.rs index 8e86af4c9c435..65e9bfb9a532e 100644 --- a/crates/rpc/rpc-engine-api/src/error.rs +++ b/crates/rpc/rpc-engine-api/src/error.rs @@ -4,7 +4,6 @@ use jsonrpsee_types::error::{ }; use reth_beacon_consensus::{BeaconForkChoiceUpdateError, BeaconOnNewPayloadError}; use reth_payload_primitives::{EngineObjectValidationError, PayloadBuilderError}; -use reth_rpc_types::ToRpcError; use thiserror::Error; /// The Engine API result type @@ -92,15 +91,15 @@ pub enum EngineApiError { /// The payload or attributes are known to be malformed before processing. #[error(transparent)] EngineObjectValidationError(#[from] EngineObjectValidationError), - /// Any other error + /// Any other rpc error #[error("{0}")] - Other(Box), + Other(jsonrpsee_types::ErrorObject<'static>), } impl EngineApiError { /// Crates a new [`EngineApiError::Other`] variant. - pub fn other(err: E) -> Self { - Self::Other(Box::new(err)) + pub fn other(err: jsonrpsee_types::ErrorObject<'static>) -> Self { + Self::Other(err) } } @@ -187,7 +186,7 @@ impl From for jsonrpsee_types::error::ErrorObject<'static> { SERVER_ERROR_MSG, Some(ErrorData::new(error)), ), - EngineApiError::Other(err) => err.to_rpc_error(), + EngineApiError::Other(err) => err, } } }