Module mock

Source
Expand description

Mock blockchain utilities. These can only be used inside tests and are not available for a wasm32 target.

Structs§

MockedBlockchain
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.
Receipt

Enums§

MockAction

Functions§

test_vm_config
with_mocked_blockchain
Perform function on a mutable reference to the MockedBlockchain. This can only be used inside tests.