Struct diem_types::block_metadata::BlockMetadata [−][src]
pub struct BlockMetadata { /* fields omitted */ }
Expand description
Struct that will be persisted on chain to store the information of the current block.
The flow will look like following:
- The executor will pass this struct to VM at the end of a block proposal.
- The VM will use this struct to create a special system transaction that will emit an event represents the information of the current block. This transaction can’t be emitted by regular users and is generated by each of the validators on the fly. Such transaction will be executed before all of the user-submitted transactions in the blocks.
- Once that special resource is modified, the other user transactions can read the consensus info by calling into the read method of that resource, which would thus give users the information such as the current leader.
Implementations
pub fn new(
id: HashValue,
round: u64,
timestamp_usecs: u64,
previous_block_votes: Vec<AccountAddress>,
proposer: AccountAddress
) -> Self
Trait Implementations
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>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for BlockMetadata
impl Send for BlockMetadata
impl Sync for BlockMetadata
impl Unpin for BlockMetadata
impl UnwindSafe for BlockMetadata
Blanket Implementations
Mutably borrows from an owned value. Read more
Generates a hash used only for tests.