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,
}
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: FunctionResultValidatorCache
Implementations§
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 !RefUnwindSafe for FunctionResultValidator
impl Send for FunctionResultValidator
impl Sync for FunctionResultValidator
impl Unpin for FunctionResultValidator
impl !UnwindSafe for FunctionResultValidator
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
Mutably borrows from an owned value. Read more