Trait light_test_utils::rpc::rpc_connection::RpcConnection

source ·
pub trait RpcConnection:
    Send
    + Sync
    + Debug
    + 'static {
Show 22 methods // Required methods fn get_program_accounts( &self, program_id: &Pubkey, ) -> Result<Vec<(Pubkey, Account)>, RpcError>; fn process_transaction( &mut self, transaction: Transaction, ) -> impl Future<Output = Result<Signature, RpcError>> + Send; fn process_transaction_with_context( &mut self, transaction: Transaction, ) -> impl Future<Output = Result<(Signature, Slot), RpcError>> + Send; fn create_and_send_transaction_with_event<T>( &mut self, instruction: &[Instruction], authority: &Pubkey, signers: &[&Keypair], transaction_params: Option<TransactionParams>, ) -> impl Future<Output = Result<Option<(T, Signature, Slot)>, RpcError>> + Send where T: AnchorDeserialize + Send + Debug; fn confirm_transaction( &self, transaction: Signature, ) -> impl Future<Output = Result<bool, RpcError>> + Send; fn get_payer(&self) -> &Keypair; fn get_account( &mut self, address: Pubkey, ) -> impl Future<Output = Result<Option<Account>, RpcError>> + Send; fn set_account(&mut self, address: &Pubkey, account: &AccountSharedData); fn get_minimum_balance_for_rent_exemption( &mut self, data_len: usize, ) -> impl Future<Output = Result<u64, RpcError>> + Send; fn airdrop_lamports( &mut self, to: &Pubkey, lamports: u64, ) -> impl Future<Output = Result<Signature, RpcError>> + Send; fn get_balance( &mut self, pubkey: &Pubkey, ) -> impl Future<Output = Result<u64, RpcError>> + Send; fn get_latest_blockhash( &mut self, ) -> impl Future<Output = Result<Hash, RpcError>> + Send; fn get_slot(&mut self) -> impl Future<Output = Result<u64, RpcError>> + Send; fn send_transaction( &self, transaction: &Transaction, ) -> impl Future<Output = Result<Signature, RpcError>> + Send; fn get_url(&self) -> String; // Provided methods fn new<U: ToString>( _url: U, _commitment_config: Option<CommitmentConfig>, ) -> Self where Self: Sized { ... } fn health(&self) -> Result<(), RpcError> { ... } fn get_block_time(&self, _slot: u64) -> Result<i64, RpcError> { ... } fn create_and_send_transaction<'a>( &'a mut self, instruction: &'a [Instruction], payer: &'a Pubkey, signers: &'a [&'a Keypair], ) -> impl Future<Output = Result<Signature, RpcError>> + Send + 'a { ... } fn get_anchor_account<'a, T: AnchorDeserialize + 'static>( &'a mut self, pubkey: &'a Pubkey, ) -> impl Future<Output = Result<Option<T>, RpcError>> + Send + 'a { ... } fn warp_to_slot(&mut self, _slot: Slot) -> Result<(), RpcError> { ... } fn get_epoch_info(&self) -> Result<EpochInfo, RpcError> { ... }
}

Required Methods§

source

fn get_program_accounts( &self, program_id: &Pubkey, ) -> Result<Vec<(Pubkey, Account)>, RpcError>

source

fn process_transaction( &mut self, transaction: Transaction, ) -> impl Future<Output = Result<Signature, RpcError>> + Send

source

fn process_transaction_with_context( &mut self, transaction: Transaction, ) -> impl Future<Output = Result<(Signature, Slot), RpcError>> + Send

source

fn create_and_send_transaction_with_event<T>( &mut self, instruction: &[Instruction], authority: &Pubkey, signers: &[&Keypair], transaction_params: Option<TransactionParams>, ) -> impl Future<Output = Result<Option<(T, Signature, Slot)>, RpcError>> + Send

source

fn confirm_transaction( &self, transaction: Signature, ) -> impl Future<Output = Result<bool, RpcError>> + Send

source

fn get_payer(&self) -> &Keypair

source

fn get_account( &mut self, address: Pubkey, ) -> impl Future<Output = Result<Option<Account>, RpcError>> + Send

source

fn set_account(&mut self, address: &Pubkey, account: &AccountSharedData)

source

fn get_minimum_balance_for_rent_exemption( &mut self, data_len: usize, ) -> impl Future<Output = Result<u64, RpcError>> + Send

source

fn airdrop_lamports( &mut self, to: &Pubkey, lamports: u64, ) -> impl Future<Output = Result<Signature, RpcError>> + Send

source

fn get_balance( &mut self, pubkey: &Pubkey, ) -> impl Future<Output = Result<u64, RpcError>> + Send

source

fn get_latest_blockhash( &mut self, ) -> impl Future<Output = Result<Hash, RpcError>> + Send

source

fn get_slot(&mut self) -> impl Future<Output = Result<u64, RpcError>> + Send

source

fn send_transaction( &self, transaction: &Transaction, ) -> impl Future<Output = Result<Signature, RpcError>> + Send

source

fn get_url(&self) -> String

Provided Methods§

source

fn new<U: ToString>( _url: U, _commitment_config: Option<CommitmentConfig>, ) -> Self
where Self: Sized,

source

fn health(&self) -> Result<(), RpcError>

source

fn get_block_time(&self, _slot: u64) -> Result<i64, RpcError>

source

fn create_and_send_transaction<'a>( &'a mut self, instruction: &'a [Instruction], payer: &'a Pubkey, signers: &'a [&'a Keypair], ) -> impl Future<Output = Result<Signature, RpcError>> + Send + 'a

source

fn get_anchor_account<'a, T: AnchorDeserialize + 'static>( &'a mut self, pubkey: &'a Pubkey, ) -> impl Future<Output = Result<Option<T>, RpcError>> + Send + 'a

source

fn warp_to_slot(&mut self, _slot: Slot) -> Result<(), RpcError>

source

fn get_epoch_info(&self) -> Result<EpochInfo, RpcError>

Object Safety§

This trait is not object safe.

Implementors§