Expand description
Re-exports§
pub use test_generator::TestGenerator;pub use anchor_client;pub use anchor_client::anchor_lang;pub use anchor_client::solana_sdk;pub use anyhow;pub use futures;pub use serial_test;pub use tokio;pub use error_reporter::*;
Modules§
- error_
reporter - idl
- The
idlmodule contains structs and functions for Anchor program code parsing. - program_
client_ generator - test_
generator
Structs§
- Client
Clientallows you to send typed RPC requests to a Solana cluster.- Commander
Commanderallows you to start localnet, build programs, run tests and do other useful operations.- Encoded
Confirmed Transaction With Status Meta - Error
- The
Errortype, a wrapper around a dynamic error type. - Instruction
- A directive for a single invocation of a Solana program.
- Keypair
- A vanilla Ed25519 key pair
- Localnet
Handle - Localnet (the validator process) handle.
- Pubkey
- The address of a Solana account.
- Reader
Readerallows you to read Pubkey, Keypair and other entities from files.- Signature
- System
- Tester
Testeris used primarily by#[trdelnik_test]macro.
Enums§
Traits§
- Future
Ext - An extension trait for
Futures that provides a variety of convenient adapters. - Id
- Defines the id of a program.
- Instruction
Data - Calculates the data for an instruction invocation, where the data is
Sha256(<namespace>:<method_name>)[..8] || BorshSerialize(args).argsis a borsh serialized struct of named fields for each argument given to an instruction. - Printable
Transaction - Utility trait for printing transaction results.
- Signer
- The
Signertrait declares operations that all digital signature providers must support. It is the primary interface by which signers are specified inTransactionsigning interfaces - Temp
Clone - The
TempClonetrait is used as a workaround for making non-cloneable foreign types cloneable. - ToAccount
Metas - Transformation to
AccountMetastructs.
Functions§
- keypair
- Returns a recognisable
Keypair/ wallet that can be used for the mint account for example. The public key will start withTxxx, where xxx are the three digits of the number. You shouldn’t call the method with the samentwice.ois used instead of0, as0is not part of the base58 charset. Thenmust be a number between0and255. - program_
keypair - Returns a recognisable Keypair of your created program. The public key will start with
Pxx, where xx are the three digits of the number.ois used instead of0, as0is not part of the base58 charset. You shouldn’t call the method with the samentwice. Thenmust be a number between0and29. - random_
keypair - Generate a random keypair.
- system_
keypair - Returns a system wallet (wallet which is owned by the system) but it is not required, you can also use the
keypairmethod bellow. The public key will start withSxx, where xx are the three digits of the number. You shouldn’t call the method with the samentwice.ois used instead of0, as0is not part of the base58 charset. Returns a recognisableKeypair. This is NOT the same asanchor_lang::system_program::System::id()! Thenmust be a number between0and29.
Attribute Macros§
- fixture
- Define a fixture that you can use in all
rstest’s test arguments. You should just mark your function as#[fixture]and then use it as a test’s argument. Fixture functions can also use other fixtures. - rstest
- The attribute that you should use for your tests. Your
annotated function’s arguments can be
injected with
[fixture]s, provided by parametrized cases or by value lists. - trdelnik_
test - The macro starts the Solana validator (localnet), runs your program test and then shuts down the validator.