pub struct Round<Id: Ord + Eq, H: Ord + Eq, N, Signature> { /* private fields */ }
Expand description

Stores data for a round.

Implementations

Create a new round accumulator for given round number and with given weight.

Return the round number.

Return the current state.

Compute and cache the precommit-GHOST.

Returns an iterator of all precommits targeting the finalized hash.

Only returns None if no block has been finalized in this round.

Fetch the “round-estimate”: the best block which might have been finalized in this round.

Returns None when new new blocks could have been finalized in this round, according to our estimate.

Fetch the most recently finalized block.

Returns true when the round is completable.

This is the case when the round-estimate is an ancestor of the prevote-ghost head, or when they are the same block and none of its children could possibly have enough precommits.

Threshold weight for supermajority.

Return the round base.

Return the round voters and weights.

Return the primary voter of the round.

Get the current weight and number of voters who have participated in prevoting.

Get the current weight and number of voters who have participated in precommitting.

Return all imported prevotes.

Return all imported precommits.

Return all votes for the round (prevotes and precommits), sorted by imported order and indicating the indices where we voted. At most two prevotes and two precommits per voter are present, further equivocations are not stored (as they are redundant).

Set the number of prevotes and precommits received at the moment of prevoting. It should be called inmediatly after prevoting.

Set the number of prevotes and precommits received at the moment of precommiting. It should be called inmediatly after precommiting.

Get the number of prevotes and precommits received at the moment of prevoting. Returns None if the prevote wasn’t realized.

Get the number of prevotes and precommits received at the moment of precommiting. Returns None if the precommit wasn’t realized.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.