Skip to main content

Module testing

Module testing 

Source
Available on crate feature testing only.
Expand description

Provides test utilities for working with accounts and account IDs within the Miden network. This module is only available when the testing feature is enabled.

Modules§

account_id
asserts
Assertion macro for note-lifecycle checks in tests.
commonstd
executor
feestd
Funding support for running the test helpers against a fee-charging chain.
mock
note_transport
standards
Raw access to miden-standards testing modules for items not curated by miden-client.
utils

Macros§

assert_execution_error
Asserts that a Result<_, ExecError> failed as expected.
assert_note_created
Asserts the tx emitted a note matching the spec. Fields are optional; unset ones are skipped.
assert_transaction_executor_error
Same as assert_execution_error!, but for TransactionExecutorError. The matches and $expected arms unwrap TransactionProgramExecutionFailed(_) and match against the inner ExecutionError.

Structs§

ClientDataStore
Wrapper structure that implements DataStore over any Store.
ExecError
A newtype wrapper around ExecutionError that provides better error messages by using PrintDiagnostic for display formatting.
MockChain
The MockChain simulates a simplified blockchain environment for testing purposes.
MockChainBuilder
A builder for a MockChain’s genesis block.
MockTransaction
Represents all needed data for executing a transaction, or arbitrary code.
MockTransactionBuilder
A builder for a MockTransaction that is coupled to a concrete MockChain.
NoteBuilder

Enums§

AccountState
Helper type for increased readability at call-sites. Indicates whether to build a new (nonce = ZERO) or existing account (nonce = ONE).
Auth
Specifies which authentication mechanism is desired for accounts
MockChainNote
Represents a note that is stored in the mock chain.
MockTransactionInput
Helper type to abstract over the account input to MockChain::build_transaction. See that method’s docs for details.

Traits§

DataStore
The data store the executor reads from, along with the trait whose methods it serves. Exposed here so that tests can exercise it on its own, without going through a transaction or a note screening pass. The DataStore trait defines the interface that transaction objects use to fetch data required for transaction execution.