Struct solana_program_test::BanksClient [−][src]
pub struct BanksClient { /* fields omitted */ }
Implementations
pub fn new<C>(
config: Config,
transport: C
) -> NewClient<BanksClient, RequestDispatch<BanksRequest, BanksResponse, C>> where
C: Transport<ClientMessage<BanksRequest>, Response<BanksResponse>>,
pub fn send_transaction_with_context(
&mut self,
ctx: Context,
transaction: Transaction
) -> impl Future<Output = Result<(), Error>>
pub fn get_fees_with_commitment_and_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel
) -> impl Future<Output = Result<(FeeCalculator, Hash, u64), Error>>
Please use get_fee_for_message
or is_blockhash_valid
instead
pub fn get_transaction_status_with_context(
&mut self,
ctx: Context,
signature: Signature
) -> impl Future<Output = Result<Option<TransactionStatus>, Error>>
pub fn get_slot_with_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel
) -> impl Future<Output = Result<u64, Error>>
pub fn get_block_height_with_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel
) -> impl Future<Output = Result<u64, Error>>
pub fn process_transaction_with_commitment_and_context(
&mut self,
ctx: Context,
transaction: Transaction,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<Result<(), TransactionError>>, Error>>
pub fn get_account_with_commitment_and_context(
&mut self,
ctx: Context,
address: Pubkey,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<Account>, Error>>
pub fn send_transaction(
&mut self,
transaction: Transaction
) -> impl Future<Output = Result<(), Error>>
pub fn send_transaction(
&mut self,
transaction: Transaction
) -> impl Future<Output = Result<(), Error>>
Send a transaction and return immediately. The server will resend the transaction until either it is accepted by the cluster or the transaction’s blockhash expires.
👎 Deprecated since 1.9.0: Please use get_fee_for_message
or is_blockhash_valid
instead
Please use get_fee_for_message
or is_blockhash_valid
instead
Return the fee parameters associated with a recent, rooted blockhash. The cluster will use the transaction’s blockhash to look up these same fee parameters and use them to calculate the transaction fee.
Return the cluster Sysvar
👎 Deprecated since 1.9.0: Please use get_latest_blockhash
instead
Please use get_latest_blockhash
instead
Return a recent, rooted blockhash from the server. The cluster will only accept
transactions with a blockhash that has not yet expired. Use the get_fees
method to get both a blockhash and the blockhash’s last valid slot.
pub fn process_transaction_with_commitment(
&mut self,
transaction: Transaction,
commitment: CommitmentLevel
) -> impl Future<Output = Result<(), TransportError>>
pub fn process_transaction_with_commitment(
&mut self,
transaction: Transaction,
commitment: CommitmentLevel
) -> impl Future<Output = Result<(), TransportError>>
Send a transaction and return after the transaction has been rejected or reached the given level of commitment.
pub fn process_transaction(
&mut self,
transaction: Transaction
) -> impl Future<Output = Result<(), TransportError>>
pub fn process_transaction(
&mut self,
transaction: Transaction
) -> impl Future<Output = Result<(), TransportError>>
Send a transaction and return until the transaction has been finalized or rejected.
pub async fn process_transactions_with_commitment(
&'_ mut self,
transactions: Vec<Transaction, Global>,
commitment: CommitmentLevel
) -> Result<(), TransportError>
pub fn process_transactions(
&mut self,
transactions: Vec<Transaction, Global>
) -> impl Future<Output = Result<(), TransportError>>
pub fn process_transactions(
&mut self,
transactions: Vec<Transaction, Global>
) -> impl Future<Output = Result<(), TransportError>>
Send transactions and return until the transaction has been finalized or rejected.
Return the most recent rooted slot. All transactions at or below this slot are said to be finalized. The cluster will not fork to a higher slot.
Return the most recent rooted block height. All transactions at or below this height are said to be finalized. The cluster will not fork to a higher block height.
pub fn get_account_with_commitment(
&mut self,
address: Pubkey,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<Account>, Error>>
pub fn get_account_with_commitment(
&mut self,
address: Pubkey,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<Account>, Error>>
Return the account at the given address at the slot corresponding to the given commitment level. If the account is not found, None is returned.
Return the account at the given address at the time of the most recent root slot. If the account is not found, None is returned.
pub fn get_packed_account_data<T>(
&mut self,
address: Pubkey
) -> impl Future<Output = Result<T, Error>> where
T: Pack,
pub fn get_packed_account_data<T>(
&mut self,
address: Pubkey
) -> impl Future<Output = Result<T, Error>> where
T: Pack,
Return the unpacked account data at the given address If the account is not found, an error is returned
pub fn get_account_data_with_borsh<T>(
&mut self,
address: Pubkey
) -> impl Future<Output = Result<T, Error>> where
T: BorshDeserialize,
pub fn get_account_data_with_borsh<T>(
&mut self,
address: Pubkey
) -> impl Future<Output = Result<T, Error>> where
T: BorshDeserialize,
Return the unpacked account data at the given address If the account is not found, an error is returned
pub fn get_balance_with_commitment(
&mut self,
address: Pubkey,
commitment: CommitmentLevel
) -> impl Future<Output = Result<u64, Error>>
pub fn get_balance_with_commitment(
&mut self,
address: Pubkey,
commitment: CommitmentLevel
) -> impl Future<Output = Result<u64, Error>>
Return the balance in lamports of an account at the given address at the slot corresponding to the given commitment level.
Return the balance in lamports of an account at the given address at the time of the most recent root slot.
Return the status of a transaction with a signature matching the transaction’s first signature. Return None if the transaction is not found, which may be because the blockhash was expired or the fee-paying account had insufficient funds to pay the transaction fee. Note that servers rarely store the full transaction history. This method may return None if the transaction status has been discarded.
Same as get_transaction_status, but for multiple transactions.
pub fn get_latest_blockhash_with_commitment(
&mut self,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<(Hash, u64)>, Error>>
pub fn get_latest_blockhash_with_commitment_and_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel
) -> impl Future<Output = Result<Option<(Hash, u64)>, Error>>
pub fn get_fee_for_message_with_commitment_and_context(
&mut self,
ctx: Context,
commitment: CommitmentLevel,
message: Message
) -> impl Future<Output = Result<Option<u64>, Error>>
Trait Implementations
Please use get_new_latest_blockhash
instead
Get a new blockhash, similar in spirit to RpcClient::get_new_blockhash() Read more
Get a new latest blockhash, similar in spirit to RpcClient::get_latest_blockhash()
Auto Trait Implementations
impl !RefUnwindSafe for BanksClient
impl Send for BanksClient
impl Sync for BanksClient
impl Unpin for BanksClient
impl !UnwindSafe for BanksClient
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more