Struct diem_sdk::types::epoch_state::EpochState
pub struct EpochState {
pub epoch: u64,
pub verifier: ValidatorVerifier,
}
Expand description
EpochState represents a trusted validator set to validate messages from the specific epoch, it could be updated with EpochChangeProof.
Fields§
§epoch: u64
§verifier: ValidatorVerifier
Implementations§
§impl EpochState
impl EpochState
pub fn empty() -> EpochState
Trait Implementations§
§impl Arbitrary for EpochState
impl Arbitrary for EpochState
§type Parameters = (<u64 as Arbitrary>::Parameters, <ValidatorVerifier as Arbitrary>::Parameters)
type Parameters = (<u64 as Arbitrary>::Parameters, <ValidatorVerifier as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<u64 as Arbitrary>::Strategy, <ValidatorVerifier as Arbitrary>::Strategy), fn(_: (u64, ValidatorVerifier)) -> EpochState>
type Strategy = Map<(<u64 as Arbitrary>::Strategy, <ValidatorVerifier as Arbitrary>::Strategy), fn(_: (u64, ValidatorVerifier)) -> EpochState>
The type of
Strategy
used to generate values of type Self
.§fn arbitrary_with(
_top: <EpochState as Arbitrary>::Parameters
) -> <EpochState as Arbitrary>::Strategy
fn arbitrary_with( _top: <EpochState as Arbitrary>::Parameters ) -> <EpochState as Arbitrary>::Strategy
§impl Clone for EpochState
impl Clone for EpochState
§fn clone(&self) -> EpochState
fn clone(&self) -> EpochState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for EpochState
impl Debug for EpochState
§impl<'de> Deserialize<'de> for EpochState
impl<'de> Deserialize<'de> for EpochState
§fn deserialize<__D>(
__deserializer: __D
) -> Result<EpochState, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<EpochState, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for EpochState
impl Display for EpochState
§impl PartialEq<EpochState> for EpochState
impl PartialEq<EpochState> for EpochState
§fn eq(&self, other: &EpochState) -> bool
fn eq(&self, other: &EpochState) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl Serialize for EpochState
impl Serialize for EpochState
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl Verifier for EpochState
impl Verifier for EpochState
§fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<(), Error>
fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<(), Error>
Verify if the ledger_info is trust worthy.
§fn epoch_change_verification_required(&self, epoch: u64) -> bool
fn epoch_change_verification_required(&self, epoch: u64) -> bool
Returns true in case the given epoch is larger than the existing verifier can support.
In this case the EpochChangeProof should be verified and the verifier updated.
§fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool
fn is_ledger_info_stale(&self, ledger_info: &LedgerInfo) -> bool
Returns true if the given
LedgerInfo
is stale and probably in our
trusted prefix. Read moreimpl Eq for EpochState
impl StructuralEq for EpochState
impl StructuralPartialEq for EpochState
Auto Trait Implementations§
impl RefUnwindSafe for EpochState
impl Send for EpochState
impl Sync for EpochState
impl Unpin for EpochState
impl UnwindSafe for EpochState
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.