pub enum OracleProcessorInstruction {
Report {
oracle_id: OracleId,
updates: Vec<OracleUpdate>,
},
}Expand description
Instructions supported by the Oracle Processor program. Made to report oracle updates from validators.
Variants§
Report
Report oracle updates from validators
Fields
§
updates: Vec<OracleUpdate>Updates from each validator
Implementations§
Source§impl OracleProcessorInstruction
impl OracleProcessorInstruction
Sourcepub fn report(
payer: Pubkey,
aggregators: Vec<(String, Pubkey)>,
oracle_id: OracleId,
updates: Vec<OracleUpdate>,
) -> Vec<Instruction>
pub fn report( payer: Pubkey, aggregators: Vec<(String, Pubkey)>, oracle_id: OracleId, updates: Vec<OracleUpdate>, ) -> Vec<Instruction>
Creates instructions for oracle reporting.
This function creates an instruction that will report an oracle update.
§Arguments
payer- The public key of the payeraggregators- A vector of tuples containing the topic and the aggregator program ID. Note: Ifupdatesis empty, no aggregation instructions will be created regardless of the aggregators provided, as there is no data to aggregate.oracle_id- The ID of the oracleupdates- A vector of oracle updates. If empty, no aggregation instructions will be generated.
§Returns
A vector of instructions to include in the transaction:
- First instruction: Report instruction that stores oracle data in a PDA
- Subsequent instructions: One aggregation instruction for each aggregator
(only if
updatesis not empty)
§Behavior
When updates is empty, the function will:
- Still create the report instruction (to maintain consistency)
- Skip all aggregation instructions, effectively ignoring the
aggregatorsparameter - Return a vector containing only the report instruction
This behavior prevents triggering aggregators when there is no oracle data to process.
Trait Implementations§
Source§impl Clone for OracleProcessorInstruction
impl Clone for OracleProcessorInstruction
Source§fn clone(&self) -> OracleProcessorInstruction
fn clone(&self) -> OracleProcessorInstruction
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 OracleProcessorInstruction
impl Debug for OracleProcessorInstruction
Source§impl<'de> Deserialize<'de> for OracleProcessorInstruction
impl<'de> Deserialize<'de> for OracleProcessorInstruction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for OracleProcessorInstruction
Auto Trait Implementations§
impl Freeze for OracleProcessorInstruction
impl RefUnwindSafe for OracleProcessorInstruction
impl Send for OracleProcessorInstruction
impl Sync for OracleProcessorInstruction
impl Unpin for OracleProcessorInstruction
impl UnwindSafe for OracleProcessorInstruction
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