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§
§impl Waypoint
impl Waypoint
pub fn new_any(ledger_info: &LedgerInfo) -> Waypoint
pub fn new_any(ledger_info: &LedgerInfo) -> Waypoint
Generate a new waypoint given any LedgerInfo.
pub fn new_epoch_boundary(ledger_info: &LedgerInfo) -> Result<Waypoint, Error>
pub fn new_epoch_boundary(ledger_info: &LedgerInfo) -> Result<Waypoint, Error>
Generates a new waypoint given the epoch change LedgerInfo.
pub fn version(&self) -> u64
pub fn value(&self) -> HashValue
pub fn verify(&self, ledger_info: &LedgerInfo) -> Result<(), Error>
pub fn verify(&self, ledger_info: &LedgerInfo) -> Result<(), Error>
Errors in case the given ledger info does not match the waypoint.
Trait Implementations§
§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
.§fn arbitrary_with(
_top: <Waypoint as Arbitrary>::Parameters
) -> <Waypoint as Arbitrary>::Strategy
fn arbitrary_with( _top: <Waypoint as Arbitrary>::Parameters ) -> <Waypoint as Arbitrary>::Strategy
§impl<'de> Deserialize<'de> for Waypoint
impl<'de> Deserialize<'de> for Waypoint
§fn deserialize<D>(
deserializer: D
) -> Result<Waypoint, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<Waypoint, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for Waypoint
impl Serialize for Waypoint
§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 Waypoint
impl Verifier for Waypoint
§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 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> 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.