#[non_exhaustive]pub struct Precommit {
pub validator: ValidatorId,
pub epoch: Height,
pub round: Round,
pub propose_hash: Hash,
pub block_hash: Hash,
pub time: DateTime<Utc>,
}
Expand description
Pre-commit for a block, essentially meaning that a validator node endorses the block. The consensus algorithm ensures that once a Byzantine majority of validators has endorsed a block, no other block at the same height may be endorsed at any point in the future. Thus, such a block can be considered committed.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.validator: ValidatorId
ID of the validator endorsing the block.
epoch: Height
The height to which the message is related.
round: Round
The round to which the message is related.
propose_hash: Hash
Hash of the block proposal. Note that the proposal format is not defined by the core.
block_hash: Hash
Hash of the new block.
time: DateTime<Utc>
Local time of the validator node when the Precommit
was created.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Precommit
impl<'de> Deserialize<'de> for Precommit
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Precommit> for CoreMessage
impl From<Precommit> for CoreMessage
Source§impl IntoMessage for Precommit
impl IntoMessage for Precommit
Source§type Container = CoreMessage
type Container = CoreMessage
Container for the message.
Source§impl Ord for Precommit
impl Ord for Precommit
Source§impl PartialOrd for Precommit
impl PartialOrd for Precommit
Source§impl ProtobufConvert for Precommit
impl ProtobufConvert for Precommit
Source§type ProtoStruct = Precommit
type ProtoStruct = Precommit
Type generated from the Protobuf definition.
Source§fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
fn from_pb(pb: Self::ProtoStruct) -> Result<Self, Error>
Performs conversion from the type generated from Protobuf.
Source§fn to_pb(&self) -> Self::ProtoStruct
fn to_pb(&self) -> Self::ProtoStruct
Performs conversion to the type generated from Protobuf.
Source§impl TryFrom<&SignedMessage> for Precommit
impl TryFrom<&SignedMessage> for Precommit
Source§impl TryFrom<CoreMessage> for Precommit
impl TryFrom<CoreMessage> for Precommit
Source§impl TryFrom<SignedMessage> for Precommit
impl TryFrom<SignedMessage> for Precommit
impl Eq for Precommit
impl StructuralPartialEq for Precommit
Auto Trait Implementations§
impl Freeze for Precommit
impl RefUnwindSafe for Precommit
impl Send for Precommit
impl Sync for Precommit
impl Unpin for Precommit
impl UnwindSafe for Precommit
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
Mutably borrows from an owned value. Read more