pub enum VerificationLevel {
Partial {
num_signatures: u8,
},
Full,
}Expand description
Pyth price updates are bridged to all blockchains via Wormhole. Using the price updates on another chain requires verifying the signatures of the Wormhole guardians. The usual process is to check the signatures for two thirds of the total number of guardians, but this can be cumbersome on Solana because of the transaction size limits, so we also allow for partial verification.
This enum represents how much a price update has been verified:
- If
Full, we have verified the signatures for two thirds of the current guardians. - If
Partial, onlynum_signaturesguardian signatures have been checked.
§Warning
Using partially verified price updates is dangerous, as it lowers the threshold of guardians that need to collude to produce a malicious price update.
Variants§
Implementations§
Source§impl VerificationLevel
impl VerificationLevel
Sourcepub fn gte(&self, other: VerificationLevel) -> bool
pub fn gte(&self, other: VerificationLevel) -> bool
Compare two VerificationLevel.
Full is always greater than Partial, and Partial with more signatures is greater than Partial with fewer signatures.
Trait Implementations§
Source§impl BorshDeserialize for VerificationLevelwhere
u8: BorshDeserialize,
impl BorshDeserialize for VerificationLevelwhere
u8: BorshDeserialize,
Source§impl BorshSerialize for VerificationLevelwhere
u8: BorshSerialize,
impl BorshSerialize for VerificationLevelwhere
u8: BorshSerialize,
Source§impl BorshSchema for VerificationLevel
impl BorshSchema for VerificationLevel
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut HashMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type. For primitive types
this is an empty map. Type definition explains how to serialize/deserialize a type.
Source§fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition>,
)
fn add_definition( declaration: String, definition: Definition, definitions: &mut HashMap<String, Definition>, )
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
Source§impl Clone for VerificationLevel
impl Clone for VerificationLevel
Source§fn clone(&self) -> VerificationLevel
fn clone(&self) -> VerificationLevel
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 VerificationLevel
impl Debug for VerificationLevel
Source§impl PartialEq for VerificationLevel
impl PartialEq for VerificationLevel
impl Copy for VerificationLevel
impl StructuralPartialEq for VerificationLevel
Auto Trait Implementations§
impl Freeze for VerificationLevel
impl RefUnwindSafe for VerificationLevel
impl Send for VerificationLevel
impl Sync for VerificationLevel
impl Unpin for VerificationLevel
impl UnwindSafe for VerificationLevel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more