Module linera_sdk::test
source · Expand description
Helper types for writing integration tests for WebAssembly applications.
Integration tests are usually written in the tests
directory in the root of the crate’s
directory (i.e., beside the src
directory). Linera application integration tests should be
executed targeting the host architecture, instead of targeting wasm32-unknown-unknown
like
done for unit tests.
Structs§
- A reference to a single microchain inside a
TestValidator
. - A helper type to build a block proposal using the builder pattern, and then signing them into
ConfirmedBlockCertificate
s using aTestValidator
. - The outcome of the execution of a query.
- A minimal validator implementation suited for tests.
Enums§
- The origin of a message coming from a particular chain. Used to identify each inbox.
- What to do with a message picked from the inbox.
- The recipient of a transfer.
Functions§
- Returns all messages logged so far.
- Sets the mocked application ID.
- Sets the mocked application parameters.
- Sets the mocked application state.
- Sets the mocked chain balance.
- Sets the mocked chain ID.
- Initializes and returns a view context for using as the mocked key-value store.
- Sets the mocked system timestamp.
- Mocks the
try_query_application
system API. - Creates a
ContractRuntime
to use in tests. - Creates a
ServiceRuntime
to use in tests.