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
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§

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.
NoteBuilder
TransactionContext
Represents all needed data for executing a transaction, or arbitrary code.
TransactionContextBuilder
TransactionContextBuilder is a utility to construct TransactionContext for testing purposes. It allows users to build accounts, create notes, provide advice inputs, and execute code. The VM process can be inspected afterward.

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.
TxContextInput
Helper type to abstract over the inputs to MockChain::build_tx_context. See that method’s docs for details.