#[repr(C)]pub struct PullFeedAccountData {Show 16 fields
pub submissions: [OracleSubmission; 32],
pub authority: Pubkey,
pub queue: Pubkey,
pub feed_hash: [u8; 32],
pub initialized_at: i64,
pub permissions: u64,
pub max_variance: u64,
pub min_responses: u32,
pub name: [u8; 32],
pub historical_result_idx: u8,
pub min_sample_size: u8,
pub last_update_timestamp: i64,
pub lut_slot: u64,
pub result: CurrentResult,
pub max_staleness: u32,
pub historical_results: [CompactResult; 32],
/* private fields */
}
Expand description
A representation of the data in a pull feed account.
Fields§
§submissions: [OracleSubmission; 32]
The oracle submissions for this feed.
The public key of the authority that can update the feed hash that this account will use for registering updates.
queue: Pubkey
The public key of the queue which oracles must be bound to in order to submit data to this feed.
feed_hash: [u8; 32]
SHA-256 hash of the job schema oracles will execute to produce data for this feed.
initialized_at: i64
The slot at which this account was initialized.
permissions: u64
§max_variance: u64
§min_responses: u32
§name: [u8; 32]
§historical_result_idx: u8
§min_sample_size: u8
§last_update_timestamp: i64
§lut_slot: u64
§result: CurrentResult
§max_staleness: u32
§historical_results: [CompactResult; 32]
Implementations§
source§impl PullFeedAccountData
impl PullFeedAccountData
pub fn discriminator() -> [u8; 8]
pub fn parse<'info>( data: Ref<'info, &mut [u8]>, ) -> Result<Ref<'info, Self>, OnDemandError>
sourcepub fn generate_checksum(&self, result: i128, slothash: [u8; 32]) -> [u8; 32]
pub fn generate_checksum(&self, result: i128, slothash: [u8; 32]) -> [u8; 32]
Generate a checksum for the given feed hash, result, slothash, max_variance and min_responses This is signed by the oracle and used to verify that the data submitted by the oracles is valid.
sourcepub fn generate_checksum_inner(
queue: Pubkey,
feed_hash: [u8; 32],
result: i128,
slothash: [u8; 32],
max_variance: u64,
min_responses: u32,
) -> [u8; 32]
pub fn generate_checksum_inner( queue: Pubkey, feed_hash: [u8; 32], result: i128, slothash: [u8; 32], max_variance: u64, min_responses: u32, ) -> [u8; 32]
Generate a checksum for the given feed hash, result, slothash, max_variance and min_responses This is signed by the oracle and used to verify that the data submitted by the oracles is valid.
sourcepub fn generate_checksum_with_timestamp(
queue: Pubkey,
feed_hash: [u8; 32],
result: i128,
slothash: [u8; 32],
max_variance: u64,
min_responses: u32,
timestamp: u64,
) -> [u8; 32]
pub fn generate_checksum_with_timestamp( queue: Pubkey, feed_hash: [u8; 32], result: i128, slothash: [u8; 32], max_variance: u64, min_responses: u32, timestamp: u64, ) -> [u8; 32]
Generate a checksum for the given feed hash, result, slothash, max_variance and min_responses This is signed by the oracle and used to verify that the data submitted by the oracles is valid.
sourcepub fn get_value(
&self,
clock: &Clock,
max_staleness: u64,
min_samples: u32,
only_positive: bool,
) -> Result<Decimal, OnDemandError>
pub fn get_value( &self, clock: &Clock, max_staleness: u64, min_samples: u32, only_positive: bool, ) -> Result<Decimal, OnDemandError>
method
get_value
Returns the median value of the submissions in the last max_staleness
slots.
If there are fewer than min_samples
submissions, returns an error.
arguments
clock
- the clock to use for the current slotmax_staleness
- the maximum number of slots to considermin_samples
- the minimum number of samples required to return a value returnsOk(Decimal)
- the median value of the submissions in the lastmax_staleness
slots
sourcepub fn value(&self) -> Option<Decimal>
pub fn value(&self) -> Option<Decimal>
The median value of the submissions needed for quorom size
sourcepub fn std_dev(&self) -> Option<Decimal>
pub fn std_dev(&self) -> Option<Decimal>
The standard deviation of the submissions needed for quorom size
Trait Implementations§
source§impl Clone for PullFeedAccountData
impl Clone for PullFeedAccountData
source§fn clone(&self) -> PullFeedAccountData
fn clone(&self) -> PullFeedAccountData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PullFeedAccountData
impl Debug for PullFeedAccountData
impl Copy for PullFeedAccountData
impl Pod for PullFeedAccountData
Auto Trait Implementations§
impl Freeze for PullFeedAccountData
impl RefUnwindSafe for PullFeedAccountData
impl Send for PullFeedAccountData
impl Sync for PullFeedAccountData
impl Unpin for PullFeedAccountData
impl UnwindSafe for PullFeedAccountData
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
§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
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)
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)
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>
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>
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