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
. - A handle to a running HTTP server.
- The outcome of the execution of a query.
- A minimal validator implementation suited for tests.
Enums§
- A type for errors happening during execution.
- 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.
- Failure to perform a GraphQL mutation on an application on a chain.
- Failure to perform a GraphQL query on an application on a chain.
- Failure to query an application’s service on a chain.
- Errors that can occur when executing a user application in a WebAssembly module.
- Error type for worker operations.
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.