Add all minimal spec endpoints

This commit is contained in:
Paul Hauner
2021-09-22 19:37:17 +10:00
parent 3d2bc6db9e
commit 08308c0000
2 changed files with 134 additions and 0 deletions

View File

@@ -45,6 +45,23 @@ pub trait EngineApi {
&self,
execution_payload: ExecutionPayload<T>,
) -> Result<ExecutePayloadResponse, Error>;
async fn get_payload<T: EthSpec>(
&self,
payload_id: PayloadId,
) -> Result<ExecutionPayload<T>, Error>;
async fn consensus_validated(
&self,
block_hash: Hash256,
status: ConsensusStatus,
) -> Result<(), Error>;
async fn forkchoice_updated(
&self,
head_block_hash: Hash256,
finalized_block_hash: Hash256,
) -> Result<(), Error>;
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
@@ -54,3 +71,10 @@ pub enum ExecutePayloadResponse {
Invalid,
Syncing,
}
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename = "SCREAMING_SNAKE_CASE")]
pub enum ConsensusStatus {
Valid,
Invalid,
}