Struct diem_types::epoch_change::EpochChangeProof
source · pub struct EpochChangeProof {
pub ledger_info_with_sigs: Vec<LedgerInfoWithSignatures>,
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>
§more: bool
Implementations§
source§impl EpochChangeProof
impl EpochChangeProof
pub fn new( ledger_info_with_sigs: Vec<LedgerInfoWithSignatures>, more: bool ) -> Self
sourcepub fn epoch(&self) -> Result<u64>
pub fn epoch(&self) -> Result<u64>
The first/lowest epoch of the proof to indicate which epoch this proof is helping with
sourcepub fn verify(
&self,
verifier: &dyn Verifier
) -> Result<&LedgerInfoWithSignatures>
pub fn verify( &self, verifier: &dyn Verifier ) -> Result<&LedgerInfoWithSignatures>
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§
source§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
.source§fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
source§impl Clone for EpochChangeProof
impl Clone for EpochChangeProof
source§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 moresource§impl Debug for EpochChangeProof
impl Debug for EpochChangeProof
source§impl<'de> Deserialize<'de> for EpochChangeProof
impl<'de> Deserialize<'de> for EpochChangeProof
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<EpochChangeProof> for EpochChangeProof
impl PartialEq<EpochChangeProof> for EpochChangeProof
source§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 ==
.source§impl Serialize for EpochChangeProof
impl Serialize for EpochChangeProof
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> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
source§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.