[][src]Struct safety_rules::ConsensusState

pub struct ConsensusState { /* fields omitted */ }

Public representation of the internal state of SafetyRules for monitoring / debugging purposes. This does not include sensitive data like private keys. @TODO add hash of ledger info (waypoint)

Implementations

impl ConsensusState[src]

pub fn new(
    safety_data: SafetyData,
    waypoint: Waypoint,
    in_validator_set: bool
) -> Self
[src]

pub fn epoch(&self) -> u64[src]

Returns the current epoch

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

Returns the last round that was voted on

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

A "preferred block" is the two-chain head with the highest block round. The expectation is that a new proposal's parent is higher or equal to the preferred_round.

pub fn waypoint(&self) -> Waypoint[src]

Last known checkpoint this should map to a LedgerInfo that contains a new ValidatorSet

pub fn in_validator_set(&self) -> bool[src]

Indicating whether the validator is validator set

pub fn safety_data(&mut self) -> SafetyData[src]

Return a copy of the safety data.

Trait Implementations

impl Clone for ConsensusState[src]

impl Debug for ConsensusState[src]

impl Default for ConsensusState[src]

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

impl Display for ConsensusState[src]

impl Eq for ConsensusState[src]

impl PartialEq<ConsensusState> for ConsensusState[src]

impl Serialize for ConsensusState[src]

impl StructuralEq for ConsensusState[src]

impl StructuralPartialEq for ConsensusState[src]

Auto Trait Implementations

impl RefUnwindSafe for ConsensusState

impl Send for ConsensusState

impl Sync for ConsensusState

impl Unpin for ConsensusState

impl UnwindSafe for ConsensusState

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: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> PersistableConfig for T where
    T: Serialize + DeserializeOwned + ?Sized
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> TestOnlyHash for T where
    T: Serialize + ?Sized
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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>,