pub struct FunctionResultValidator {
pub client: Arc<RwLock<AnchorClient>>,
pub rpc: Arc<RpcClient>,
pub payer: Arc<Keypair>,
pub verifier: Arc<Pubkey>,
pub verifier_enclave_signer: FunctionResultValidatorSigner,
pub reward_receiver: Arc<Pubkey>,
pub attestation_queue: Arc<Pubkey>,
pub queue_authority: Arc<Pubkey>,
pub quote_verify_fn: Arc<Box<QuoteVerifyFn>>,
pub cache: FunctionResultValidatorCache,
}Available on non-
target_os="solana" only.Expand description
Represents a VerifierAccountData oracle and verifies an emitted FunctionResult
Fields§
§client: Arc<RwLock<AnchorClient>>§rpc: Arc<RpcClient>§payer: Arc<Keypair>§verifier: Arc<Pubkey>§verifier_enclave_signer: FunctionResultValidatorSigner§reward_receiver: Arc<Pubkey>§attestation_queue: Arc<Pubkey>§quote_verify_fn: Arc<Box<QuoteVerifyFn>>§cache: FunctionResultValidatorCacheImplementations§
Source§impl FunctionResultValidator
impl FunctionResultValidator
Sourcepub fn new(
client: Arc<RwLock<AnchorClient>>,
rpc: Arc<RpcClient>,
payer: Arc<Keypair>,
verifier_enclave_signer: FunctionResultValidatorSigner,
accounts: &FunctionResultValidatorInitAccounts,
quote_verify_fn: impl Fn(&[u8], i64) -> bool + 'static + Send + Sync,
cache: Option<FunctionResultValidatorCache>,
) -> Self
pub fn new( client: Arc<RwLock<AnchorClient>>, rpc: Arc<RpcClient>, payer: Arc<Keypair>, verifier_enclave_signer: FunctionResultValidatorSigner, accounts: &FunctionResultValidatorInitAccounts, quote_verify_fn: impl Fn(&[u8], i64) -> bool + 'static + Send + Sync, cache: Option<FunctionResultValidatorCache>, ) -> Self
Create a new instance of the FunctionResultValidator
pub async fn load( client: Arc<RwLock<AnchorClient>>, payer: Arc<Keypair>, verifier: Pubkey, verifier_enclave_signer: Option<FunctionResultValidatorSigner>, reward_receiver: Option<Pubkey>, quote_verify_fn: impl Fn(&[u8], i64) -> bool + 'static + Send + Sync, cache: Option<FunctionResultValidatorCache>, ) -> Result<Self, SbError>
pub async fn load_from_cluster( cluster: Cluster, payer: Arc<Keypair>, verifier: Pubkey, verifier_enclave_signer: Option<FunctionResultValidatorSigner>, reward_receiver: Option<Pubkey>, quote_verify_fn: impl Fn(&[u8], i64) -> bool + 'static + Send + Sync, cache: Option<FunctionResultValidatorCache>, ) -> Result<Self, SbError>
Sourcepub fn is_production(&self) -> bool
pub fn is_production(&self) -> bool
Whether the validator is in production mode and is ready to sign and send transactions.
Sourcepub fn is_simulation(&self) -> bool
pub fn is_simulation(&self) -> bool
Whether the validator is in simulation mode and is ready to validate function requests.
Sourcepub async fn process(
&self,
function_result: &FunctionResult,
) -> Result<Signature, SbError>
pub async fn process( &self, function_result: &FunctionResult, ) -> Result<Signature, SbError>
The entrypoint for the QVN. Verifies a FunctionResult and returns a transaction signature if successful.
Sourcepub async fn validate(
&self,
function_result: &FunctionResult,
) -> Result<Transaction, SbError>
pub async fn validate( &self, function_result: &FunctionResult, ) -> Result<Transaction, SbError>
Validate the function result and return any errors
Trait Implementations§
Source§impl Clone for FunctionResultValidator
impl Clone for FunctionResultValidator
Source§fn clone(&self) -> FunctionResultValidator
fn clone(&self) -> FunctionResultValidator
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 moreAuto Trait Implementations§
impl Freeze for FunctionResultValidator
impl !RefUnwindSafe for FunctionResultValidator
impl Send for FunctionResultValidator
impl Sync for FunctionResultValidator
impl Unpin for FunctionResultValidator
impl !UnwindSafe for FunctionResultValidator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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