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.

Assemble the given instructions into a transaction and sign it. All transactions constructed by this method are signed and payed for by the payer.

Assemble the given instructions into a transaction and sign it. All transactions executed by this method are signed and payed for by the payer.

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.

Gets and deserializes an account. None if the account does not exist.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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