Struct diem_sdk::types::epoch_change::EpochChangeProof
pub struct EpochChangeProof {
pub ledger_info_with_sigs: Vec<LedgerInfoWithSignatures, Global>,
pub more: bool,
}
Expand description
A vector of LedgerInfo with contiguous increasing epoch numbers to prove a sequence of epoch changes from the first LedgerInfo’s epoch.
Fields§
§ledger_info_with_sigs: Vec<LedgerInfoWithSignatures, Global>
§more: bool
Implementations§
§impl EpochChangeProof
impl EpochChangeProof
pub fn new( ledger_info_with_sigs: Vec<LedgerInfoWithSignatures, Global>, more: bool ) -> EpochChangeProof
pub fn epoch(&self) -> Result<u64, Error>
pub fn epoch(&self) -> Result<u64, Error>
The first/lowest epoch of the proof to indicate which epoch this proof is helping with
pub fn verify(
&self,
verifier: &dyn Verifier
) -> Result<&LedgerInfoWithSignatures, Error>
pub fn verify( &self, verifier: &dyn Verifier ) -> Result<&LedgerInfoWithSignatures, Error>
Verify the proof is correctly chained with known epoch and validator
verifier and return the LedgerInfoWithSignatures
to start target epoch.
In case a waypoint is present, it’s going to be used for verifying the very first epoch change (it’s the responsibility of the caller to not pass a waypoint in case it’s not needed).
We will also skip any stale ledger info’s in the EpochChangeProof
.
Trait Implementations§
§impl Arbitrary for EpochChangeProof
impl Arbitrary for EpochChangeProof
§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<EpochChangeProof>
type Strategy = BoxedStrategy<EpochChangeProof>
The type of
Strategy
used to generate values of type Self
.§fn arbitrary_with(
_args: <EpochChangeProof as Arbitrary>::Parameters
) -> <EpochChangeProof as Arbitrary>::Strategy
fn arbitrary_with( _args: <EpochChangeProof as Arbitrary>::Parameters ) -> <EpochChangeProof as Arbitrary>::Strategy
§impl Clone for EpochChangeProof
impl Clone for EpochChangeProof
§fn clone(&self) -> EpochChangeProof
fn clone(&self) -> EpochChangeProof
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 EpochChangeProof
impl Debug for EpochChangeProof
§impl<'de> Deserialize<'de> for EpochChangeProof
impl<'de> Deserialize<'de> for EpochChangeProof
§fn deserialize<__D>(
__deserializer: __D
) -> Result<EpochChangeProof, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<EpochChangeProof, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq<EpochChangeProof> for EpochChangeProof
impl PartialEq<EpochChangeProof> for EpochChangeProof
§fn eq(&self, other: &EpochChangeProof) -> bool
fn eq(&self, other: &EpochChangeProof) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl Serialize for EpochChangeProof
impl Serialize for EpochChangeProof
§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 Eq for EpochChangeProof
impl StructuralEq for EpochChangeProof
impl StructuralPartialEq for EpochChangeProof
Auto Trait Implementations§
impl RefUnwindSafe for EpochChangeProof
impl Send for EpochChangeProof
impl Sync for EpochChangeProof
impl Unpin for EpochChangeProof
impl UnwindSafe for EpochChangeProof
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.