Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sb on-demand update #1328

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions programs/switchboard-on-demand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ pub struct CurrentResult {
pub min_value: i128,
/// The maximum value of the submissions needed for quorom size
pub max_value: i128,
/// The number of samples used to calculate this result
pub num_samples: u8,
pub padding1: [u8; 7],
/// The index of the submission that was used to calculate this result
pub submission_idx: u8,
pub padding1: [u8; 6],
/// The slot at which this value was signed.
pub slot: u64,
/// The slot at which the first considered submission was made
Expand Down Expand Up @@ -123,7 +126,8 @@ pub struct OracleSubmission {
pub oracle: Pubkey,
/// The slot at which this value was signed.
pub slot: u64,
padding1: [u8; 8],
/// The slot at which this value was landed on chain.
pub landed_at: u64,
/// The value that was submitted.
pub value: i128,
}
Expand Down Expand Up @@ -209,3 +213,9 @@ impl PullFeedAccountData {
self.result.max_value()
}
}
impl PullFeedAccountData {
pub fn result_land_slot(&self) -> u64 {
let submission = self.submissions[self.result.submission_idx as usize];
submission.landed_at
}
}
Loading