[][src]Struct exonum::messages::Prevote

pub struct Prevote { /* fields omitted */ }

Pre-vote for a new block.

Validation

A node panics if it has already sent a different Prevote for the same round.

Processing

Pre-vote is added to the list of known votes for the same proposal. If locked_round number from the message is bigger than in a node state, then a node replies with PrevotesRequest. If there are unknown transactions in the propose specified by propose_hash, TransactionsRequest is sent in reply. Otherwise if all transactions are known and there are +2/3 pre-votes, then a node is locked to that proposal and Precommit is broadcast.

Generation

A node broadcasts Prevote in response to Propose when it has received all the transactions.

Methods

impl Prevote
[src]

pub fn new(
    validator: ValidatorId,
    height: Height,
    round: Round,
    propose_hash: &Hash,
    locked_round: Round,
    secret_key: &SecretKey
) -> Prevote
[src]

Creates message and signs it.

pub fn new_with_signature(
    validator: ValidatorId,
    height: Height,
    round: Round,
    propose_hash: &Hash,
    locked_round: Round,
    signature: &Signature
) -> Prevote
[src]

Creates message and appends existing signature.

pub fn to_hex(&self) -> String
[src]

Returns the hex representation of the binary data. Lower case letters are used (e.g. f9b4ca).

pub fn validator(&self) -> ValidatorId
[src]

The validator id.

pub fn height(&self) -> Height
[src]

The height to which the message is related.

pub fn round(&self) -> Round
[src]

The round to which the message is related.

pub fn propose_hash(&self) -> &Hash
[src]

Hash of the corresponding Propose.

pub fn locked_round(&self) -> Round
[src]

Locked round.

Trait Implementations

impl ExonumJson for Prevote
[src]

impl ExonumJsonDeserialize for Prevote
[src]

impl<'a> SegmentField<'a> for Prevote
[src]

impl ServiceMessage for Prevote
[src]

impl Message for Prevote
[src]

fn verify_signature(&self, pub_key: &PublicKey) -> bool
[src]

Verifies the message using given public key.

impl VoteMessage for Prevote
[src]

impl StorageValue for Prevote
[src]

impl PartialEq<Prevote> for Prevote
[src]

impl AsRef<RawMessage> for Prevote
[src]

impl Clone for Prevote
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Prevote
[src]

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

impl Serialize for Prevote
[src]

impl FromHex for Prevote
[src]

type Error = Error

Auto Trait Implementations

impl Send for Prevote

impl Sync for Prevote

Blanket Implementations

impl<T> CryptoHash for T where
    T: Message
[src]

impl<T> SerializeContent for T where
    T: Serialize
[src]

impl<T> From for T
[src]

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

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Erased for T

impl<T> Erased for T

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

impl<T> Same for T

type Output = T

Should always be Self