Struct switchboard_solana::attestation_program::instructions::function_verify::FunctionVerify
source · pub struct FunctionVerify<'info> {
pub function: AccountInfo<'info>,
pub function_enclave_signer: Signer<'info>,
pub verifier: AccountInfo<'info>,
pub verifier_signer: Signer<'info>,
pub verifier_permission: AccountInfo<'info>,
pub escrow_wallet: AccountInfo<'info>,
pub escrow_token_wallet: AccountInfo<'info>,
pub receiver: AccountInfo<'info>,
pub attestation_queue: AccountInfo<'info>,
pub token_program: AccountInfo<'info>,
}
Fields§
§function: AccountInfo<'info>
#[account( mut, seeds = [ FUNCTION_SEED, function.load()?.creator_seed.as_ref(), &function.load()?.created_at_slot.to_le_bytes() ], bump = function.load()?.bump, has_one = attestation_queue @ SwitchboardError::InvalidQueue, has_one = escrow_token_wallet @ SwitchboardError::InvalidEscrow, has_one = escrow_wallet, )] pub function: AccountLoader<’info, FunctionAccountData>,
function_enclave_signer: Signer<'info>
§verifier: AccountInfo<'info>
#[account( has_one = attestation_queue @ SwitchboardError::InvalidQueue, constraint = verifier.load()?.enclave.enclave_signer == verifier_signer.key() @ SwitchboardError::InvalidEnclaveSigner, )] pub verifier: AccountLoader<’info, VerifierAccountData>,
verifier_signer: Signer<'info>
§verifier_permission: AccountInfo<'info>
#[account( seeds = [ PERMISSION_SEED, attestation_queue.load()?.authority.as_ref(), attestation_queue.key().as_ref(), verifier.key().as_ref() ], bump = verifier_permission.load()?.bump, )] pub verifier_permission: AccountLoader<’info, AttestationPermissionAccountData>,
escrow_wallet: AccountInfo<'info>
pub escrow_wallet: Box<Account<’info, SwitchboardWallet>>,
escrow_token_wallet: AccountInfo<'info>
#[account( mut, constraint = escrow_token_wallet.is_native() )] pub escrow_token_wallet: Box<Account<’info, TokenAccount>>,
receiver: AccountInfo<'info>
#[account( mut, constraint = receiver.is_native() )] pub receiver: Box<Account<’info, TokenAccount>>,
attestation_queue: AccountInfo<'info>
pub attestation_queue: AccountLoader<’info, AttestationQueueAccountData>,
token_program: AccountInfo<'info>
pub token_program: Program<’info, Token>,
Implementations§
source§impl<'info> FunctionVerify<'info>
impl<'info> FunctionVerify<'info>
pub fn get_instruction( &self, program_id: Pubkey, params: FunctionVerifyParams ) -> Result<Instruction>
pub fn invoke( &self, program: AccountInfo<'info>, observed_time: i64, next_allowed_timestamp: i64, error_code: u8, mr_enclave: [u8; 32] ) -> ProgramResult
pub fn invoke_signed( &self, program: AccountInfo<'info>, observed_time: i64, next_allowed_timestamp: i64, error_code: u8, mr_enclave: [u8; 32], signer_seeds: &[&[&[u8]]] ) -> ProgramResult
pub fn build_ix( accounts: &FunctionVerifyAccounts, params: &FunctionVerifyParams ) -> Result<Instruction, SbError>
Trait Implementations§
source§impl<'info> Accounts<'info, FunctionVerifyBumps> for FunctionVerify<'info>where
'info: 'info,
impl<'info> Accounts<'info, FunctionVerifyBumps> for FunctionVerify<'info>where
'info: 'info,
source§fn try_accounts(
__program_id: &Pubkey,
__accounts: &mut &'info [AccountInfo<'info>],
__ix_data: &[u8],
__bumps: &mut FunctionVerifyBumps,
__reallocs: &mut BTreeSet<Pubkey>
) -> Result<Self>
fn try_accounts( __program_id: &Pubkey, __accounts: &mut &'info [AccountInfo<'info>], __ix_data: &[u8], __bumps: &mut FunctionVerifyBumps, __reallocs: &mut BTreeSet<Pubkey> ) -> Result<Self>
Mint
account from the SPL token program in a particular
field, then it should be impossible for this method to return Ok
if
any other account type is given–from the SPL token program or elsewhere. Read moresource§impl<'info> AccountsExit<'info> for FunctionVerify<'info>where
'info: 'info,
impl<'info> AccountsExit<'info> for FunctionVerify<'info>where
'info: 'info,
source§impl<'info> Bumps for FunctionVerify<'info>where
'info: 'info,
impl<'info> Bumps for FunctionVerify<'info>where
'info: 'info,
§type Bumps = FunctionVerifyBumps
type Bumps = FunctionVerifyBumps
source§impl Discriminator for FunctionVerify<'_>
impl Discriminator for FunctionVerify<'_>
const DISCRIMINATOR: [u8; 8] = _
fn discriminator() -> [u8; 8]
source§impl<'info> ToAccountInfos<'info> for FunctionVerify<'info>where
'info: 'info,
impl<'info> ToAccountInfos<'info> for FunctionVerify<'info>where
'info: 'info,
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>
source§impl<'info> ToAccountMetas for FunctionVerify<'info>
impl<'info> ToAccountMetas for FunctionVerify<'info>
source§fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>
is_signer
is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client.