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_signatures
guardian 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,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
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 duplicate 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 EnumExt for VerificationLevelwhere
u8: BorshDeserialize,
impl EnumExt for VerificationLevelwhere
u8: BorshDeserialize,
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