mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-14 08:55:01 -05:00
chore: cleanup engine api errors (#2674)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{EngineApiError, EngineApiMessageVersion, EngineApiResult};
|
||||
use async_trait::async_trait;
|
||||
use jsonrpsee_core::RpcResult as Result;
|
||||
use jsonrpsee_core::RpcResult;
|
||||
use reth_beacon_consensus::BeaconConsensusEngineHandle;
|
||||
use reth_interfaces::consensus::ForkchoiceState;
|
||||
use reth_payload_builder::PayloadStore;
|
||||
@@ -296,14 +296,14 @@ where
|
||||
/// Handler for `engine_newPayloadV1`
|
||||
/// See also <https://github.com/ethereum/execution-apis/blob/8db51dcd2f4bdfbd9ad6e4a7560aac97010ad063/src/engine/specification.md#engine_newpayloadv1>
|
||||
/// Caution: This should not accept the `withdrawals` field
|
||||
async fn new_payload_v1(&self, payload: ExecutionPayload) -> Result<PayloadStatus> {
|
||||
async fn new_payload_v1(&self, payload: ExecutionPayload) -> RpcResult<PayloadStatus> {
|
||||
trace!(target: "rpc::eth", "Serving engine_newPayloadV1");
|
||||
Ok(EngineApi::new_payload_v1(self, payload).await?)
|
||||
}
|
||||
|
||||
/// Handler for `engine_newPayloadV1`
|
||||
/// See also <https://github.com/ethereum/execution-apis/blob/8db51dcd2f4bdfbd9ad6e4a7560aac97010ad063/src/engine/specification.md#engine_newpayloadv1>
|
||||
async fn new_payload_v2(&self, payload: ExecutionPayload) -> Result<PayloadStatus> {
|
||||
async fn new_payload_v2(&self, payload: ExecutionPayload) -> RpcResult<PayloadStatus> {
|
||||
trace!(target: "rpc::eth", "Serving engine_newPayloadV1");
|
||||
Ok(EngineApi::new_payload_v2(self, payload).await?)
|
||||
}
|
||||
@@ -316,7 +316,7 @@ where
|
||||
&self,
|
||||
fork_choice_state: ForkchoiceState,
|
||||
payload_attributes: Option<PayloadAttributes>,
|
||||
) -> Result<ForkchoiceUpdated> {
|
||||
) -> RpcResult<ForkchoiceUpdated> {
|
||||
trace!(target: "rpc::eth", "Serving engine_forkchoiceUpdatedV1");
|
||||
Ok(EngineApi::fork_choice_updated_v1(self, fork_choice_state, payload_attributes).await?)
|
||||
}
|
||||
@@ -327,7 +327,7 @@ where
|
||||
&self,
|
||||
fork_choice_state: ForkchoiceState,
|
||||
payload_attributes: Option<PayloadAttributes>,
|
||||
) -> Result<ForkchoiceUpdated> {
|
||||
) -> RpcResult<ForkchoiceUpdated> {
|
||||
trace!(target: "rpc::eth", "Serving engine_forkchoiceUpdatedV2");
|
||||
Ok(EngineApi::fork_choice_updated_v2(self, fork_choice_state, payload_attributes).await?)
|
||||
}
|
||||
@@ -343,7 +343,7 @@ where
|
||||
///
|
||||
/// Note:
|
||||
/// > Client software MAY stop the corresponding build process after serving this call.
|
||||
async fn get_payload_v1(&self, payload_id: PayloadId) -> Result<ExecutionPayload> {
|
||||
async fn get_payload_v1(&self, payload_id: PayloadId) -> RpcResult<ExecutionPayload> {
|
||||
trace!(target: "rpc::eth", "Serving engine_getPayloadV1");
|
||||
Ok(EngineApi::get_payload_v1(self, payload_id).await?)
|
||||
}
|
||||
@@ -357,7 +357,7 @@ where
|
||||
///
|
||||
/// Note:
|
||||
/// > Client software MAY stop the corresponding build process after serving this call.
|
||||
async fn get_payload_v2(&self, payload_id: PayloadId) -> Result<ExecutionPayloadEnvelope> {
|
||||
async fn get_payload_v2(&self, payload_id: PayloadId) -> RpcResult<ExecutionPayloadEnvelope> {
|
||||
trace!(target: "rpc::eth", "Serving engine_getPayloadV2");
|
||||
Ok(EngineApi::get_payload_v2(self, payload_id).await?)
|
||||
}
|
||||
@@ -367,7 +367,7 @@ where
|
||||
async fn get_payload_bodies_by_hash_v1(
|
||||
&self,
|
||||
block_hashes: Vec<BlockHash>,
|
||||
) -> Result<ExecutionPayloadBodies> {
|
||||
) -> RpcResult<ExecutionPayloadBodies> {
|
||||
trace!(target: "rpc::eth", "Serving engine_getPayloadBodiesByHashV1");
|
||||
Ok(EngineApi::get_payload_bodies_by_hash(self, block_hashes)?)
|
||||
}
|
||||
@@ -378,7 +378,7 @@ where
|
||||
&self,
|
||||
start: U64,
|
||||
count: U64,
|
||||
) -> Result<ExecutionPayloadBodies> {
|
||||
) -> RpcResult<ExecutionPayloadBodies> {
|
||||
trace!(target: "rpc::eth", "Serving engine_getPayloadBodiesByHashV1");
|
||||
Ok(EngineApi::get_payload_bodies_by_range(self, start.as_u64(), count.as_u64())?)
|
||||
}
|
||||
@@ -388,14 +388,14 @@ where
|
||||
async fn exchange_transition_configuration(
|
||||
&self,
|
||||
config: TransitionConfiguration,
|
||||
) -> Result<TransitionConfiguration> {
|
||||
) -> RpcResult<TransitionConfiguration> {
|
||||
trace!(target: "rpc::eth", "Serving engine_getPayloadBodiesByHashV1");
|
||||
Ok(EngineApi::exchange_transition_configuration(self, config)?)
|
||||
}
|
||||
|
||||
/// Handler for `engine_exchangeCapabilitiesV1`
|
||||
/// See also <https://github.com/ethereum/execution-apis/blob/6452a6b194d7db269bf1dbd087a267251d3cc7f8/src/engine/common.md#capabilities>
|
||||
async fn exchange_capabilities(&self, _capabilities: Vec<String>) -> Result<Vec<String>> {
|
||||
async fn exchange_capabilities(&self, _capabilities: Vec<String>) -> RpcResult<Vec<String>> {
|
||||
Ok(CAPABILITIES.into_iter().map(str::to_owned).collect())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user