diff --git a/crates/engine/src/client.rs b/crates/engine/src/client.rs index f908628..294a112 100644 --- a/crates/engine/src/client.rs +++ b/crates/engine/src/client.rs @@ -7,6 +7,7 @@ use alloy_provider::{ReqwestProvider, RootProvider}; use alloy_rpc_client::RpcClient; use alloy_rpc_types_engine::{ ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, JwtSecret, PayloadId, PayloadStatus, + ExecutionPayloadEnvelopeV2, }; use alloy_transport_http::{ hyper_util::{ @@ -64,13 +65,21 @@ impl EngineClient { impl Engine for EngineClient { type Error = EngineError; - async fn get_payload( + async fn get_payload_v2( + &self, + payload_id: PayloadId, + ) -> Result { + self.engine.get_payload_v2(payload_id).await.map_err(|_| EngineError::PayloadError) + } + + async fn get_payload_v3( &self, payload_id: PayloadId, ) -> Result { self.engine.get_payload_v3(payload_id).await.map_err(|_| EngineError::PayloadError) } + async fn forkchoice_update( &self, state: ForkchoiceState, diff --git a/crates/engine/src/traits.rs b/crates/engine/src/traits.rs index ae923b9..cec49e4 100644 --- a/crates/engine/src/traits.rs +++ b/crates/engine/src/traits.rs @@ -4,6 +4,7 @@ use alloy_eips::eip1898::BlockNumberOrTag; use alloy_primitives::B256; use alloy_rpc_types_engine::{ ExecutionPayloadV3, ForkchoiceState, ForkchoiceUpdated, PayloadId, PayloadStatus, + ExecutionPayloadEnvelopeV2, }; use async_trait::async_trait; use op_alloy_protocol::L2BlockInfo; @@ -17,7 +18,13 @@ pub trait Engine { type Error: core::fmt::Debug; /// Gets a payload for the given payload id. - async fn get_payload( + async fn get_payload_v2( + &self, + payload_id: PayloadId, + ) -> Result; + + /// Gets a payload for the given payload id. + async fn get_payload_v3( &self, payload_id: PayloadId, ) -> Result;