pub struct BlockHeader {Show 15 fields
pub chain_id: ChainId,
pub epoch: Epoch,
pub height: BlockHeight,
pub timestamp: Timestamp,
pub state_hash: CryptoHash,
pub previous_block_hash: Option<CryptoHash>,
pub authenticated_signer: Option<AccountOwner>,
pub bundles_hash: CryptoHash,
pub operations_hash: CryptoHash,
pub messages_hash: CryptoHash,
pub previous_message_blocks_hash: CryptoHash,
pub oracle_responses_hash: CryptoHash,
pub events_hash: CryptoHash,
pub blobs_hash: CryptoHash,
pub operation_results_hash: CryptoHash,
}Expand description
Succinct representation of a block. Contains all the metadata to follow the chain of blocks or verifying inclusion (event, message, oracle response, etc.) in the block’s body.
Fields§
§chain_id: ChainIdThe chain to which this block belongs.
epoch: EpochThe number identifying the current configuration.
height: BlockHeightThe block height.
timestamp: TimestampThe timestamp when this block was created.
state_hash: CryptoHashThe hash of the chain’s execution state after this block.
previous_block_hash: Option<CryptoHash>Certified hash of the previous block in the chain, if any.
authenticated_signer: Option<AccountOwner>The user signing for the operations in the block and paying for their execution
fees. If set, this must be the owner in the block proposal. None means that
the default account of the chain is used. This value is also used as recipient of
potential refunds for the message grants created by the operations.
bundles_hash: CryptoHashCryptographic hash of all the incoming bundles in the block.
operations_hash: CryptoHashCryptographic hash of all the operations in the block.
messages_hash: CryptoHashCryptographic hash of all the messages in the block.
previous_message_blocks_hash: CryptoHashCryptographic hash of the lookup table for previous sending blocks.
oracle_responses_hash: CryptoHashCryptographic hash of all the oracle responses in the block.
events_hash: CryptoHashCryptographic hash of all the events in the block.
blobs_hash: CryptoHashCryptographic hash of all the created blobs in the block.
operation_results_hash: CryptoHashA cryptographic hash of the execution results of all operations in a block.
Implementations§
Source§impl BlockHeader
impl BlockHeader
pub async fn chain_id(&self, ctx: &Context<'_>) -> Result<&ChainId>
pub async fn epoch(&self, ctx: &Context<'_>) -> Result<&Epoch>
pub async fn height(&self, ctx: &Context<'_>) -> Result<&BlockHeight>
pub async fn timestamp(&self, ctx: &Context<'_>) -> Result<&Timestamp>
pub async fn state_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn previous_block_hash( &self, ctx: &Context<'_>, ) -> Result<&Option<CryptoHash>>
pub async fn authenticated_signer( &self, ctx: &Context<'_>, ) -> Result<&Option<AccountOwner>>
pub async fn bundles_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn operations_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn messages_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn previous_message_blocks_hash( &self, ctx: &Context<'_>, ) -> Result<&CryptoHash>
pub async fn oracle_responses_hash( &self, ctx: &Context<'_>, ) -> Result<&CryptoHash>
pub async fn events_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn blobs_hash(&self, ctx: &Context<'_>) -> Result<&CryptoHash>
pub async fn operation_results_hash( &self, ctx: &Context<'_>, ) -> Result<&CryptoHash>
Trait Implementations§
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ContainerType for BlockHeader
impl ContainerType for BlockHeader
Source§async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async fn resolve_field(&self, ctx: &Context<'_>) -> ServerResult<Option<Value>>
async_graphql::Value. Read moreSource§fn collect_all_fields<'a>(
&'a self,
ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>,
fields: &mut Fields<'a>,
) -> Result<(), ServerError>
fn collect_all_fields<'a>( &'a self, ctx: &ContextBase<'a, &'a Positioned<SelectionSet>>, fields: &mut Fields<'a>, ) -> Result<(), ServerError>
Source§fn find_entity(
&self,
_: &ContextBase<'_, &Positioned<Field>>,
_params: &ConstValue,
) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
fn find_entity( &self, _: &ContextBase<'_, &Positioned<Field>>, _params: &ConstValue, ) -> impl Future<Output = Result<Option<ConstValue>, ServerError>> + Send
Source§impl Debug for BlockHeader
impl Debug for BlockHeader
Source§impl<'de> Deserialize<'de> for BlockHeader
impl<'de> Deserialize<'de> for BlockHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for BlockHeader
impl Hash for BlockHeader
Source§impl OutputType for BlockHeader
impl OutputType for BlockHeader
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Source§async fn resolve(
&self,
ctx: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, ctx: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
async_graphql::Value.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Source§impl PartialEq for BlockHeader
impl PartialEq for BlockHeader
Source§impl Serialize for BlockHeader
impl Serialize for BlockHeader
impl Eq for BlockHeader
impl ObjectType for BlockHeader
impl StructuralPartialEq for BlockHeader
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length bytes from memory from the provided location.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes to memory at the provided location.