[][src]Struct exonum::messages::Precommit

#[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>,
}

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)

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.

Methods

impl Precommit[src]

pub fn new(
    validator: ValidatorId,
    epoch: Height,
    round: Round,
    propose_hash: Hash,
    block_hash: Hash,
    time: DateTime<Utc>
) -> Self
[src]

Create new Precommit message.

Trait Implementations

impl Clone for Precommit[src]

impl Debug for Precommit[src]

impl<'de> Deserialize<'de> for Precommit[src]

impl Eq for Precommit[src]

impl From<Precommit> for CoreMessage[src]

impl IntoMessage for Precommit[src]

type Container = CoreMessage

Container for the message.

impl Ord for Precommit[src]

impl PartialEq<Precommit> for Precommit[src]

impl PartialOrd<Precommit> for Precommit[src]

impl ProtobufConvert for Precommit[src]

type ProtoStruct = Precommit

Type generated from the Protobuf definition.

impl Serialize for Precommit[src]

impl StructuralEq for Precommit[src]

impl StructuralPartialEq for Precommit[src]

impl<'_> TryFrom<&'_ SignedMessage> for Precommit[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<CoreMessage> for Precommit[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<SignedMessage> for Precommit[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,