Crate soroban_test_helpers

Crate soroban_test_helpers 

Source
Expand description

§Soroban Test Helpers

This crate provides helpful macros and utilities for testing Soroban smart contracts.

§Features

  • #[test] attribute macro: Simplifies writing tests for Soroban contracts by:
    • Automatically creating a test environment
    • Generating test addresses as needed
    • Reducing boilerplate in test code

§Example

use soroban_test_helpers::test;
use soroban_sdk::{Env, Address};

#[test]
fn my_soroban_contract_test(env: Env, user: Address) {
    // Test logic here
    // `env` is automatically created with default settings
    // `user` is automatically generated with env
}

Attribute Macros§

test
A procedural macro for simplifying Soroban contract tests.