Expand description

Mock utilities used for testing and overriding the syscall interface for contracts.

Structs

Mocked blockchain that can be used in the tests for the smart contracts. It implements BlockchainInterface by redirecting calls to VMLogic. It unwraps errors of VMLogic to cause panic during the unit tests similarly to how errors of VMLogic would cause the termination of guest program execution. Unit tests can even assert the expected error message.
Context for the contract execution.
Simple VMContext builder that allows to quickly create custom context in tests.

Enums

Functions

Initializes a new mocked blockchain with the given context. This keeps existing storage.
Replaces the mocked blockchain instance with the passed in one.
Perform function on a mutable reference to the MockedBlockchain. This can only be used inside tests.