Struct switchboard_on_demand::on_demand::accounts::oracle::OracleAccountData
source · #[repr(C)]pub struct OracleAccountData {
pub enclave: Quote,
pub authority: Pubkey,
pub queue: Pubkey,
pub created_at: i64,
pub last_heartbeat: i64,
pub secp_authority: [u8; 64],
pub gateway_uri: [u8; 64],
pub permissions: u64,
pub is_on_queue: u8,
pub lut_slot: u64,
pub last_reward_epoch: u64,
/* private fields */
}
Fields§
§enclave: Quote
Represents the state of the quote verifiers enclave.
The authority of the EnclaveAccount which is permitted to make account changes.
queue: Pubkey
Queue used for attestation to verify a MRENCLAVE measurement.
created_at: i64
The unix timestamp when the quote was created.
last_heartbeat: i64
The last time the quote heartbeated on-chain.
gateway_uri: [u8; 64]
URI location of the verifier’s gateway.
permissions: u64
§is_on_queue: u8
Whether the quote is located on the AttestationQueues buffer.
lut_slot: u64
§last_reward_epoch: u64
Implementations§
source§impl OracleAccountData
impl OracleAccountData
pub fn size() -> usize
sourcepub fn new<'info>(
quote_account_info: &'info AccountInfo<'info>,
) -> Result<Ref<'info, OracleAccountData>, OnDemandError>
pub fn new<'info>( quote_account_info: &'info AccountInfo<'info>, ) -> Result<Ref<'info, OracleAccountData>, OnDemandError>
sourcepub fn new_from_bytes(data: &[u8]) -> Result<&OracleAccountData, OnDemandError>
pub fn new_from_bytes(data: &[u8]) -> Result<&OracleAccountData, OnDemandError>
pub fn signer(&self) -> Pubkey
pub fn is_stale(&self, clock: &Clock) -> bool
pub fn is_verified(&self, clock: &Clock) -> bool
pub fn verify(&self, clock: &Clock) -> Result<(), OnDemandError>
pub fn gateway_uri(&self) -> Option<String>
pub fn ed25519_signer(&self) -> Option<Pubkey>
pub fn secp256k1_signer(&self) -> Option<[u8; 64]>
pub fn libsecp256k1_signer(&self) -> Option<PublicKey>
pub fn stats_key(key: &Pubkey) -> Pubkey
pub fn feed_stats_key(feed: &Pubkey, oracle: &Pubkey) -> (Pubkey, u8)
pub fn feed_stats_seed<'a>( feed: &'a [u8], oracle: &'a [u8], bump: &'a [u8], ) -> [&'a [u8]; 4]
pub async fn fetch_async( client: &RpcClient, pubkey: Pubkey, ) -> Result<Self, OnDemandError>
pub async fn fetch_many( client: &RpcClient, oracles: &[Pubkey], ) -> Result<Vec<OracleAccountData>, OnDemandError>
pub async fn fetch_lut( &self, oracle_pubkey: &Pubkey, client: &RpcClient, ) -> Result<AddressLookupTableAccount, OnDemandError>
Trait Implementations§
source§impl AccountDeserialize for OracleAccountData
impl AccountDeserialize for OracleAccountData
source§fn try_deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program were to implement this trait,
it should be impossible to deserialize a
Mint
account into a token
Account
.source§fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, Error>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes account data without checking the account discriminator.
This should only be used on account initialization, when the bytes of
the account are zeroed.
source§impl Clone for OracleAccountData
impl Clone for OracleAccountData
source§fn clone(&self) -> OracleAccountData
fn clone(&self) -> OracleAccountData
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 OracleAccountData
impl Debug for OracleAccountData
source§impl Discriminator for OracleAccountData
impl Discriminator for OracleAccountData
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
impl Copy for OracleAccountData
impl Pod for OracleAccountData
Auto Trait Implementations§
impl Freeze for OracleAccountData
impl RefUnwindSafe for OracleAccountData
impl Send for OracleAccountData
impl Sync for OracleAccountData
impl Unpin for OracleAccountData
impl UnwindSafe for OracleAccountData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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