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§
- Active
Chain - A reference to a single microchain inside a
TestValidator
. - Block
Builder - A helper type to build a block proposal using the builder pattern, and then signing them into
ConfirmedBlockCertificate
s using aTestValidator
. - Http
Server - A handle to a running HTTP server.
- Query
Outcome - The outcome of the execution of a query.
- Test
Validator - A minimal validator implementation suited for tests.
Enums§
- Chain
Error - Chain
Execution Context - Execution
Error - A type for errors happening during execution.
- Message
Action - What to do with a message picked from the inbox.
- Recipient
- The recipient of a transfer.
- TryGraphQL
Mutation Error - Failure to perform a GraphQL mutation on an application on a chain.
- TryGraphQL
Query Error - Failure to perform a GraphQL query on an application on a chain.
- TryQuery
Error - Failure to query an application’s service on a chain.
- Wasm
Execution Error - Errors that can occur when executing a user application in a WebAssembly module.
- Worker
Error - Error type for worker operations.
Functions§
- log_
messages - Returns all messages logged so far.
- mock_
application_ id - Sets the mocked application ID.
- mock_
application_ parameters - Sets the mocked application parameters.
- mock_
application_ state - Sets the mocked application state.
- mock_
chain_ balance - Sets the mocked chain balance.
- mock_
chain_ id - Sets the mocked chain ID.
- mock_
key_ value_ store - Initializes and returns a view context for using as the mocked key-value store.
- mock_
system_ timestamp - Sets the mocked system timestamp.
- mock_
try_ query_ application - Mocks the
try_query_application
system API. - test_
contract_ runtime - Creates a
ContractRuntime
to use in tests. - test_
service_ runtime - Creates a
ServiceRuntime
to use in tests.