[][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)


impl ConsensusState[src]

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

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

impl<T, U> Into<U> for T where
    U: From<T>, 

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

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

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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