Trait hotshot_types::traits::block_contents::BlockHeader
source · pub trait BlockHeader<TYPES: NodeType>:
Serialize
+ Clone
+ Debug
+ Hash
+ PartialEq
+ Eq
+ Send
+ Sync
+ DeserializeOwned
+ Committable {
type Error: Error + Debug + Send + Sync;
// Required methods
fn new_legacy(
parent_state: &TYPES::ValidatedState,
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
parent_leaf: &Leaf2<TYPES>,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
builder_fee: BuilderFee<TYPES>,
vid_common: VidCommon,
version: Version,
) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn new_marketplace(
parent_state: &TYPES::ValidatedState,
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
parent_leaf: &Leaf2<TYPES>,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
builder_fee: Vec<BuilderFee<TYPES>>,
view_number: u64,
vid_common: VidCommon,
auction_results: Option<TYPES::AuctionResult>,
version: Version,
) -> impl Future<Output = Result<Self, Self::Error>> + Send;
fn genesis(
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
) -> Self;
fn block_number(&self) -> u64;
fn payload_commitment(&self) -> VidCommitment;
fn metadata(
&self,
) -> &<TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata;
fn builder_commitment(&self) -> BuilderCommitment;
fn get_auction_results(&self) -> Option<TYPES::AuctionResult>;
}
Expand description
Header of a block, which commits to a BlockPayload
.
Required Associated Types§
Required Methods§
sourcefn new_legacy(
parent_state: &TYPES::ValidatedState,
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
parent_leaf: &Leaf2<TYPES>,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
builder_fee: BuilderFee<TYPES>,
vid_common: VidCommon,
version: Version,
) -> impl Future<Output = Result<Self, Self::Error>> + Send
fn new_legacy( parent_state: &TYPES::ValidatedState, instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance, parent_leaf: &Leaf2<TYPES>, payload_commitment: VidCommitment, builder_commitment: BuilderCommitment, metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata, builder_fee: BuilderFee<TYPES>, vid_common: VidCommon, version: Version, ) -> impl Future<Output = Result<Self, Self::Error>> + Send
Build a header with the parent validate state, instance-level state, parent leaf, payload and builder commitments, and metadata. This is only used in pre-marketplace versions
sourcefn new_marketplace(
parent_state: &TYPES::ValidatedState,
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
parent_leaf: &Leaf2<TYPES>,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
builder_fee: Vec<BuilderFee<TYPES>>,
view_number: u64,
vid_common: VidCommon,
auction_results: Option<TYPES::AuctionResult>,
version: Version,
) -> impl Future<Output = Result<Self, Self::Error>> + Send
fn new_marketplace( parent_state: &TYPES::ValidatedState, instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance, parent_leaf: &Leaf2<TYPES>, payload_commitment: VidCommitment, builder_commitment: BuilderCommitment, metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata, builder_fee: Vec<BuilderFee<TYPES>>, view_number: u64, vid_common: VidCommon, auction_results: Option<TYPES::AuctionResult>, version: Version, ) -> impl Future<Output = Result<Self, Self::Error>> + Send
Build a header with the parent validate state, instance-level state, parent leaf, payload and builder commitments, metadata, and auction results. This is only used in post-marketplace versions
sourcefn genesis(
instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance,
payload_commitment: VidCommitment,
builder_commitment: BuilderCommitment,
metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata,
) -> Self
fn genesis( instance_state: &<TYPES::ValidatedState as ValidatedState<TYPES>>::Instance, payload_commitment: VidCommitment, builder_commitment: BuilderCommitment, metadata: <TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata, ) -> Self
Build the genesis header, payload, and metadata.
sourcefn block_number(&self) -> u64
fn block_number(&self) -> u64
Get the block number.
sourcefn payload_commitment(&self) -> VidCommitment
fn payload_commitment(&self) -> VidCommitment
Get the payload commitment.
sourcefn metadata(&self) -> &<TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata
fn metadata(&self) -> &<TYPES::BlockPayload as BlockPayload<TYPES>>::Metadata
Get the metadata.
sourcefn builder_commitment(&self) -> BuilderCommitment
fn builder_commitment(&self) -> BuilderCommitment
Get the builder commitment
sourcefn get_auction_results(&self) -> Option<TYPES::AuctionResult>
fn get_auction_results(&self) -> Option<TYPES::AuctionResult>
Get the results of the auction for this Header. Only used in post-marketplace versions
Object Safety§
This trait is not object safe.