Module cosmwasm_vm::testing

source ·

Structs

Zero-pads all human addresses to make them fit the canonical_length and trims off zeros for the reverse operation. This is not really smart, but allows us to see a difference (and consistent length for canonical adddresses).
MockQuerier holds an immutable table of bank balances

Constants

Functions

Mimicks the call signature of the smart contracts. Thus it moves env and msg rather than take them as reference. This is inefficient here, but only used in test code.
All external requirements that can be injected for unit tests. It sets the given balance for the contract itself, nothing else
Initializes the querier along with the mock_dependencies. Sets all balances provided (yoy must explicitly set contract balance if desired)
Returns a default enviroment 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.
Just set sender and funds for the message. This is intended for use in test code only.
Creates InstanceOptions for testing
Creates an instance from the given Wasm bytecode. The gas limit is measured in CosmWasm gas.
Runs a series of IO tests, hammering especially on allocate and deallocate. This could be especially useful when run with some kind of leak detector.