pub struct MockPythOracleBuilder<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> MockPythOracleBuilder<'a>
impl<'a> MockPythOracleBuilder<'a>
pub fn new(ctx: &'a mut TestContext) -> Self
Sourcepub fn price(self, price: i64) -> Self
pub fn price(self, price: i64) -> Self
Set the price value (in smallest units based on exponent) For example, $100 with exponent -8 = 100_00000000
Sourcepub fn confidence(self, conf: u64) -> Self
pub fn confidence(self, conf: u64) -> Self
Set the confidence interval
Sourcepub fn publish_time(self, time: i64) -> Self
pub fn publish_time(self, time: i64) -> Self
Set the publish time (defaults to current system time)
Sourcepub fn feed_id(self, id: [u8; 32]) -> Self
pub fn feed_id(self, id: [u8; 32]) -> Self
Set a custom feed ID (defaults to oracle pubkey bytes)
Sourcepub fn program_id(self, id: Pubkey) -> Self
pub fn program_id(self, id: Pubkey) -> Self
Override the Pyth program ID (defaults to Pyth Solana Receiver)
Auto Trait Implementations§
impl<'a> Freeze for MockPythOracleBuilder<'a>
impl<'a> !RefUnwindSafe for MockPythOracleBuilder<'a>
impl<'a> Send for MockPythOracleBuilder<'a>
impl<'a> Sync for MockPythOracleBuilder<'a>
impl<'a> Unpin for MockPythOracleBuilder<'a>
impl<'a> UnsafeUnpin for MockPythOracleBuilder<'a>
impl<'a> !UnwindSafe for MockPythOracleBuilder<'a>
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
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