Testing in Acton
Learn how to write and run tests for Tolk smart contracts
This section contains guides and reference documentation for the Acton test runner.
Generating wrappers
Generate wrappers for Tolk smart contracts
Test attributes
Control test behavior, skip tests, and set expectations with @test.* attributes
Fuzz testing
Run parameterized tests with generated inputs, assumptions, and bounds
Test configuration
Configure the test runner in Acton.toml and with CLI flags
World state snapshots
Save and restore local emulation state as JSON fixtures inside tests
Step-by-step execution
Use testing.createTraceIterationCursor() and TxCursor to run transaction chains in parts
Test UI
Inspect traces, transaction trees, logs, failures, coverage, and gas profiles in the browser UI
Saved trace bundles
Reference for JSON artifacts from acton test --save-test-trace, reused by the Test UI
Built-in matchers and helpers
Reference for transaction predicates, map expectations, and out-action helpers
Reading transaction chains
Read the text trace format from println(txs) and matcher failures
Gas profiling and snapshots
Profile gas hot paths, inspect flamegraphs, save snapshots, and compare baselines
Fork testing
Test contracts against real chain state by forking testnet or mainnet
Code coverage
Measure and inspect code coverage in Tolk smart contract tests
Mutation testing
Run mutation testing to assess the test suite quality and find hidden gaps in the coverage
Cookbook
Short examples for common assertions, helpers, and scenarios in tests
Custom matchers
Extend expect() with domain-specific matchers
Last updated on