Add executePayload

This commit is contained in:
Paul Hauner
2021-09-22 19:03:12 +10:00
parent 18dc88f194
commit 3d2bc6db9e
2 changed files with 88 additions and 5 deletions

View File

@@ -1,7 +1,8 @@
use async_trait::async_trait;
use eth1::http::RpcError;
use serde::{Deserialize, Serialize};
pub use types::{Address, Hash256};
pub use types::{Address, EthSpec, ExecutionPayload, Hash256};
pub mod http;
@@ -39,4 +40,17 @@ pub trait EngineApi {
random: Hash256,
fee_recipient: Address,
) -> Result<PayloadId, Error>;
async fn execute_payload<T: EthSpec>(
&self,
execution_payload: ExecutionPayload<T>,
) -> Result<ExecutePayloadResponse, Error>;
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename = "SCREAMING_SNAKE_CASE")]
pub enum ExecutePayloadResponse {
Valid,
Invalid,
Syncing,
}