Module testing

Module testing 

Source
Expand description

Exposed for testing only Both unit tests and integration tests are compiled to native code, so everything in here does not need to compile to Wasm.

Structs§

BankQuerier
MockApi
MockQuerier
MockQuerier holds an immutable table of bank balances and configurable handlers for Wasm queries and custom queries.

Constants§

MOCK_CONTRACT_ADDR

Functions§

message_info
A constructor function for MessageInfo.
mock_dependencies
Creates all external requirements that can be injected for unit tests.
mock_dependencies_with_balance
Creates all external requirements that can be injected for unit tests.
mock_dependencies_with_balances
Initializes the querier along with the mock_dependencies. Sets all balances provided (you must explicitly set contract balance if desired).
mock_env
Returns a default environment with height, time, chain_id, and contract address. You can submit as is to most contracts, or modify height/time if you want to test for expiration.
mock_infoDeprecated
Just set sender and funds for the message. This is intended for use in test code only.
mock_wasmd_attr
Only for test code. This bypasses assertions in new, allowing us to create _* Attributes to simulate responses from the blockchain

Type Aliases§

MockQuerierCustomHandlerResult
The same type as cosmwasm-std’s QuerierResult, but easier to reuse in cosmwasm-vm. It might diverge from QuerierResult at some point.
MockStorage