Struct trdelnik_client::Commander
source · pub struct Commander { /* private fields */ }Expand description
Commander allows you to start localnet, build programs,
run tests and do other useful operations.
Implementations§
source§impl Commander
impl Commander
sourcepub fn with_root(root: impl Into<Cow<'static, str>>) -> Self
pub fn with_root(root: impl Into<Cow<'static, str>>) -> Self
Creates a new Commander instance with the provided root.
sourcepub async fn build_programs(&self) -> Result<(), Error>
pub async fn build_programs(&self) -> Result<(), Error>
Builds programs (smart contracts).
sourcepub async fn run_tests(&self) -> Result<(), Error>
pub async fn run_tests(&self) -> Result<(), Error>
Runs standard Rust tests.
Note: The –nocapture argument is used
to allow you read println outputs in your terminal window.
sourcepub async fn run_fuzzer(&self, target: String) -> Result<(), Error>
pub async fn run_fuzzer(&self, target: String) -> Result<(), Error>
Runs fuzzer on the given target.
sourcepub async fn run_fuzzer_debug(
&self,
target: String,
crash_file_path: String
) -> Result<(), Error>
pub async fn run_fuzzer_debug( &self, target: String, crash_file_path: String ) -> Result<(), Error>
Runs fuzzer on the given target.
sourcepub async fn create_program_client_crate(&self) -> Result<(), Error>
pub async fn create_program_client_crate(&self) -> Result<(), Error>
Creates the program_client crate.
It’s used internally by the #[trdelnik_test] macro.
sourcepub fn program_packages(&self) -> impl Iterator<Item = Package>
pub fn program_packages(&self) -> impl Iterator<Item = Package>
sourcepub async fn generate_program_client_deps(&self) -> Result<(), Error>
pub async fn generate_program_client_deps(&self) -> Result<(), Error>
Updates the program_client dependencies.
It’s used internally by the #[trdelnik_test] macro.
sourcepub async fn generate_program_client_lib_rs(&self) -> Result<(), Error>
pub async fn generate_program_client_lib_rs(&self) -> Result<(), Error>
Updates the program_client lib.rs.
It’s used internally by the #[trdelnik_test] macro.
sourcepub async fn format_program_code(code: &str) -> Result<String, Error>
pub async fn format_program_code(code: &str) -> Result<String, Error>
Formats program code.
sourcepub async fn start_localnet(&self) -> Result<LocalnetHandle, Error>
pub async fn start_localnet(&self) -> Result<LocalnetHandle, Error>
Starts the localnet (Solana validator).
sourcepub async fn parse_program_client_imports(&self) -> Result<Vec<ItemUse>, Error>
pub async fn parse_program_client_imports(&self) -> Result<Vec<ItemUse>, Error>
Returns use modules / statements
The goal of this method is to find all use statements defined by the user in the .program_client
crate. It solves the problem with regenerating the program client and removing imports defined by
the user.