mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
chore: rm ToRpcError usage from engine crate (#11311)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8635,7 +8635,6 @@ dependencies = [
|
|||||||
"reth-primitives",
|
"reth-primitives",
|
||||||
"reth-provider",
|
"reth-provider",
|
||||||
"reth-rpc-api",
|
"reth-rpc-api",
|
||||||
"reth-rpc-types",
|
|
||||||
"reth-rpc-types-compat",
|
"reth-rpc-types-compat",
|
||||||
"reth-storage-api",
|
"reth-storage-api",
|
||||||
"reth-tasks",
|
"reth-tasks",
|
||||||
|
|||||||
@ -16,7 +16,6 @@ workspace = true
|
|||||||
reth-chainspec.workspace = true
|
reth-chainspec.workspace = true
|
||||||
reth-primitives.workspace = true
|
reth-primitives.workspace = true
|
||||||
reth-rpc-api.workspace = true
|
reth-rpc-api.workspace = true
|
||||||
reth-rpc-types.workspace = true
|
|
||||||
reth-storage-api.workspace = true
|
reth-storage-api.workspace = true
|
||||||
reth-beacon-consensus.workspace = true
|
reth-beacon-consensus.workspace = true
|
||||||
reth-payload-builder.workspace = true
|
reth-payload-builder.workspace = true
|
||||||
|
|||||||
@ -4,7 +4,6 @@ use jsonrpsee_types::error::{
|
|||||||
};
|
};
|
||||||
use reth_beacon_consensus::{BeaconForkChoiceUpdateError, BeaconOnNewPayloadError};
|
use reth_beacon_consensus::{BeaconForkChoiceUpdateError, BeaconOnNewPayloadError};
|
||||||
use reth_payload_primitives::{EngineObjectValidationError, PayloadBuilderError};
|
use reth_payload_primitives::{EngineObjectValidationError, PayloadBuilderError};
|
||||||
use reth_rpc_types::ToRpcError;
|
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
/// The Engine API result type
|
/// The Engine API result type
|
||||||
@ -92,15 +91,15 @@ pub enum EngineApiError {
|
|||||||
/// The payload or attributes are known to be malformed before processing.
|
/// The payload or attributes are known to be malformed before processing.
|
||||||
#[error(transparent)]
|
#[error(transparent)]
|
||||||
EngineObjectValidationError(#[from] EngineObjectValidationError),
|
EngineObjectValidationError(#[from] EngineObjectValidationError),
|
||||||
/// Any other error
|
/// Any other rpc error
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Other(Box<dyn ToRpcError>),
|
Other(jsonrpsee_types::ErrorObject<'static>),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EngineApiError {
|
impl EngineApiError {
|
||||||
/// Crates a new [`EngineApiError::Other`] variant.
|
/// Crates a new [`EngineApiError::Other`] variant.
|
||||||
pub fn other<E: ToRpcError>(err: E) -> Self {
|
pub const fn other(err: jsonrpsee_types::ErrorObject<'static>) -> Self {
|
||||||
Self::Other(Box::new(err))
|
Self::Other(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ impl From<EngineApiError> for jsonrpsee_types::error::ErrorObject<'static> {
|
|||||||
SERVER_ERROR_MSG,
|
SERVER_ERROR_MSG,
|
||||||
Some(ErrorData::new(error)),
|
Some(ErrorData::new(error)),
|
||||||
),
|
),
|
||||||
EngineApiError::Other(err) => err.to_rpc_error(),
|
EngineApiError::Other(err) => err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user