Struct poc_framework::LocalEnvironment [−][src]
pub struct LocalEnvironment { /* fields omitted */ }Expand description
An clean environment that executes transactions locally. Good for testing and debugging. This environment has the most important SPL programs: spl-token, spl-associated-token-account and spl-memo v1 and v3.
Implementations
Constructs a builder for a local environment
Constructs a clean local environment.
Trait Implementations
Returns the keypair used to pay for all transactions. All transaction fees and rent costs are payed for by this keypair.
Executes the batch of transactions in the right order and waits for them to be confirmed. The execution results are returned.
Fetch a recent blockhash, for construction of transactions.
Fetch the amount of lamports needed for an account of the given size to be rent excempt.
Fetch an account. None if the account does not exist.
fn tx_with_instructions(
    &self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> Transaction
fn tx_with_instructions(
    &self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> Transaction
Assemble the given instructions into a transaction and sign it. All transactions constructed by this method are signed and payed for by the payer.
fn execute_as_transaction(
    &mut self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> EncodedConfirmedTransaction
fn execute_as_transaction(
    &mut self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> EncodedConfirmedTransaction
Assemble the given instructions into a transaction and sign it. All transactions executed by this method are signed and payed for by the payer.
fn execute_as_transaction_debug(
    &mut self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> EncodedConfirmedTransaction
fn execute_as_transaction_debug(
    &mut self, 
    instructions: &[Instruction], 
    signers: &[&Keypair]
) -> EncodedConfirmedTransaction
Assemble the given instructions into a transaction and sign it. All transactions executed by this method are signed and payed for by the payer. Prints the transaction before sending it. Read more
Executes a transaction constructing an empty account with the specified amount of space and lamports, owned by the provided program.
Executes a transaction constructing an empty rent-excempt account with the specified amount of space, owned by the provided program.
Executes a transaction constructing a token mint. The account needs to be empty and belong to system for this to work.
Executes a transaction that mints tokens from a mint to an account belonging to that mint.
Executes a transaction constructing a token account of the specified mint. The account needs to be empty and belong to system for this to work. Prefer to use [create_associated_token_account] if you don’t need the provided account to contain the token account. Read more
Executes a transaction constructing the associated token account of the specified mint belonging to the owner. This will fail if the account already exists.
Executes a transaction constructing the associated token account of the specified mint belonging to the owner.
Executes a transaction creating and filling the given account with the given data. The account is required to be empty and will be owned by bpf_loader afterwards. Read more
Executes a transaction deploying a program from a file if it does not already exist. The keypair is derived from the file contents. Read more
Gets and unpacks an account. None if the account does not exist.
Gets and deserializes an account. None if the account does not exist.
fn get_serde_deserialized_account<'a, T: DeserializeOwned>(
    &self, 
    pubkey: Pubkey
) -> Option<T>
fn get_serde_deserialized_account<'a, T: DeserializeOwned>(
    &self, 
    pubkey: Pubkey
) -> Option<T>
Gets and deserializes an account. None if the account does not exist.
Auto Trait Implementations
impl !RefUnwindSafe for LocalEnvironment
impl Send for LocalEnvironment
impl Sync for LocalEnvironment
impl Unpin for LocalEnvironment
impl !UnwindSafe for LocalEnvironment
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more
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