Enum near_chain::BlockHeader [−][src]
pub enum BlockHeader {
BlockHeaderV1(Box<BlockHeaderV1, Global>),
BlockHeaderV2(Box<BlockHeaderV2, Global>),
}
Expand description
Versioned BlockHeader data structure. For each next version, document what are the changes between versions.
Variants
BlockHeaderV1(Box<BlockHeaderV1, Global>)
Tuple Fields of BlockHeaderV1
0: Box<BlockHeaderV1, Global>
BlockHeaderV2(Box<BlockHeaderV2, Global>)
Tuple Fields of BlockHeaderV2
0: Box<BlockHeaderV2, Global>
Implementations
pub fn new(
protocol_version: u32,
height: u64,
prev_hash: CryptoHash,
prev_state_root: CryptoHash,
chunk_receipts_root: CryptoHash,
chunk_headers_root: CryptoHash,
chunk_tx_root: CryptoHash,
outcome_root: CryptoHash,
timestamp: u64,
challenges_root: CryptoHash,
random_value: CryptoHash,
validator_proposals: Vec<ValidatorStakeV1, Global>,
chunk_mask: Vec<bool, Global>,
epoch_id: EpochId,
next_epoch_id: EpochId,
gas_price: u128,
total_supply: u128,
challenges_result: Vec<SlashedValidator, Global>,
signer: &dyn ValidatorSigner,
last_final_block: CryptoHash,
last_ds_final_block: CryptoHash,
approvals: Vec<Option<Signature>, Global>,
next_bp_hash: CryptoHash,
block_merkle_root: CryptoHash
) -> BlockHeader
pub fn genesis(
genesis_protocol_version: u32,
height: u64,
state_root: CryptoHash,
chunk_receipts_root: CryptoHash,
chunk_headers_root: CryptoHash,
chunk_tx_root: CryptoHash,
num_shards: u64,
challenges_root: CryptoHash,
timestamp: DateTime<Utc>,
initial_gas_price: u128,
initial_total_supply: u128,
next_bp_hash: CryptoHash
) -> BlockHeader
Verifies that given public key produced the block.
Trait Implementations
impl BorshDeserialize for BlockHeader where
Box<BlockHeaderV1, Global>: BorshDeserialize,
Box<BlockHeaderV2, Global>: BorshDeserialize,
impl BorshDeserialize for BlockHeader where
Box<BlockHeaderV1, Global>: BorshDeserialize,
Box<BlockHeaderV2, Global>: BorshDeserialize,
impl BorshSerialize for BlockHeader where
Box<BlockHeaderV1, Global>: BorshSerialize,
Box<BlockHeaderV2, Global>: BorshSerialize,
impl BorshSerialize for BlockHeader where
Box<BlockHeaderV1, Global>: BorshSerialize,
Box<BlockHeaderV2, Global>: BorshSerialize,
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more