Struct diem_types::waypoint::Waypoint
source · pub struct Waypoint { /* private fields */ }
Expand description
Waypoint keeps information about the LedgerInfo on a given version, which provides an off-chain mechanism to verify the sync process right after the restart. At high level, a trusted waypoint verifies the LedgerInfo for a certain epoch change. For more information, please refer to the Waypoints documentation.
Implementations§
source§impl Waypoint
impl Waypoint
sourcepub fn new_any(ledger_info: &LedgerInfo) -> Self
pub fn new_any(ledger_info: &LedgerInfo) -> Self
Generate a new waypoint given any LedgerInfo.
sourcepub fn new_epoch_boundary(ledger_info: &LedgerInfo) -> Result<Self>
pub fn new_epoch_boundary(ledger_info: &LedgerInfo) -> Result<Self>
Generates a new waypoint given the epoch change LedgerInfo.
pub fn version(&self) -> Version
pub fn value(&self) -> HashValue
sourcepub fn verify(&self, ledger_info: &LedgerInfo) -> Result<()>
pub fn verify(&self, ledger_info: &LedgerInfo) -> Result<()>
Errors in case the given ledger info does not match the waypoint.
Trait Implementations§
source§impl Arbitrary for Waypoint
impl Arbitrary for Waypoint
§type Parameters = (<u64 as Arbitrary>::Parameters, <HashValue as Arbitrary>::Parameters)
type Parameters = (<u64 as Arbitrary>::Parameters, <HashValue 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, <HashValue as Arbitrary>::Strategy), fn(_: (u64, HashValue)) -> Waypoint>
type Strategy = Map<(<u64 as Arbitrary>::Strategy, <HashValue as Arbitrary>::Strategy), fn(_: (u64, HashValue)) -> Waypoint>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl<'de> Deserialize<'de> for Waypoint
impl<'de> Deserialize<'de> for Waypoint
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<Waypoint> for Waypoint
impl PartialEq<Waypoint> for Waypoint
source§impl Verifier for Waypoint
impl Verifier for Waypoint
source§fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>
fn verify(&self, ledger_info: &LedgerInfoWithSignatures) -> Result<()>
Verify if the ledger_info is trust worthy.
source§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.
source§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 Copy for Waypoint
impl Eq for Waypoint
impl StructuralEq for Waypoint
impl StructuralPartialEq for Waypoint
Auto Trait Implementations§
impl RefUnwindSafe for Waypoint
impl Send for Waypoint
impl Sync for Waypoint
impl Unpin for Waypoint
impl UnwindSafe for Waypoint
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.