diff --git a/api/builder.toml b/api/builder.toml index d5bd8ae..e64b94d 100644 --- a/api/builder.toml +++ b/api/builder.toml @@ -54,8 +54,8 @@ Get the specified block candidate. Returns application-specific encoded transactions type """ -[route.claim_header] -PATH = ["claimheader/:block_hash/:signature"] +[route.claim_header_input] +PATH = ["claimheaderinput/:block_hash/:signature"] ":block_hash" = "TaggedBase64" ":signature" = "TaggedBase64" DOC = """ diff --git a/src/block_info.rs b/src/block_info.rs index 2649527..4bcdaf3 100644 --- a/src/block_info.rs +++ b/src/block_info.rs @@ -1,7 +1,8 @@ use std::{hash::Hash, marker::PhantomData}; use hotshot_types::{ - traits::{node_implementation::NodeType, signature_key::SignatureKey}, + data::{VidScheme, VidSchemeTrait}, + traits::{node_implementation::NodeType, signature_key::SignatureKey, BlockPayload}, utils::BuilderCommitment, }; use serde::{Deserialize, Serialize}; @@ -21,6 +22,7 @@ pub struct AvailableBlockInfo { #[serde(bound = "")] pub struct AvailableBlockData { pub block_payload: ::BlockPayload, + pub metadata: <::BlockPayload as BlockPayload>::Metadata, pub signature: <::SignatureKey as SignatureKey>::PureAssembledSignatureType, pub sender: ::SignatureKey, pub _phantom: PhantomData, @@ -28,8 +30,8 @@ pub struct AvailableBlockData { #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, Hash)] #[serde(bound = "")] -pub struct AvailableBlockHeader { - pub block_header: ::BlockHeader, +pub struct AvailableBlockHeaderInput { + pub vid_commitment: ::Commit, pub signature: <::SignatureKey as SignatureKey>::PureAssembledSignatureType, pub sender: ::SignatureKey, pub _phantom: PhantomData, diff --git a/src/builder.rs b/src/builder.rs index 4d04a8d..6cfd65a 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -150,12 +150,12 @@ where } .boxed() })? - .get("claim_header", |req, state| { + .get("claim_header_input", |req, state| { async move { let hash: BuilderCommitment = req.blob_param("block_hash")?; let signature = req.blob_param("signature")?; state - .claim_block_header(&hash, &signature) + .claim_block_header_input(&hash, &signature) .await .context(BlockClaimSnafu { resource: hash.to_string(), diff --git a/src/data_source.rs b/src/data_source.rs index d969979..e2ac3e9 100644 --- a/src/data_source.rs +++ b/src/data_source.rs @@ -7,7 +7,7 @@ use hotshot_types::{ use tagged_base64::TaggedBase64; use crate::{ - block_info::{AvailableBlockData, AvailableBlockHeader, AvailableBlockInfo}, + block_info::{AvailableBlockData, AvailableBlockHeaderInput, AvailableBlockInfo}, builder::BuildError, }; @@ -27,11 +27,11 @@ where block_hash: &BuilderCommitment, signature: &<::SignatureKey as SignatureKey>::PureAssembledSignatureType, ) -> Result, BuildError>; - async fn claim_block_header( + async fn claim_block_header_input( &self, block_hash: &BuilderCommitment, signature: &<::SignatureKey as SignatureKey>::PureAssembledSignatureType, - ) -> Result, BuildError>; + ) -> Result, BuildError>; } #[async_trait]