Features

Features

Features summary

All MultiTest features are listed in the table below.

The Default implementation column indicates whether the feature has a default implementation in MultiTest that simulates the functionality of the real blockchain as closely as possible. In cases where MultiTest does not have a default implementation for the feature, you can provide your own, using AppBuilder's function listed in AppBuilder constructor column. Names of MultiTest feature flags required to enable specific functionality are shown in the column Feature flag.

FeatureDefault
implementation
Feature
flag
AppBuilder
constructor
Functionality
Blocksmock_env().block (opens in a new tab)with_blockOperations on blocks.
APIMockApi (opens in a new tab)with_apiAccess to CosmWasm API.
StorageMockStorage (opens in a new tab)with_storageAccess to storage.
BankBankKeeper (opens in a new tab)with_bankInteractions with Bank module.
StakingStakeKeeper (opens in a new tab)stakingwith_stakingInteractions with Staking module.
DistributionDistributionKeeper (opens in a new tab)stakingwith_distributionInteractions with Distribution module.
GovernanceGovFailingModule (opens in a new tab)with_govInteractions with Governance module.
StargateStargateFailing (opens in a new tab)stargatewith_stargateOperations using Stargate and/or Any messages.
WasmWasmKeeper (opens in a new tab)with_wasmInteractions with Wasm module.
CustomFailingModule (opens in a new tab)new_customOperations using custom module.
IBCIbcFailingModule (opens in a new tab)stargatewith_ibcInter-blockchain communication operations.

Feature flags summary

The following table summarizes feature flags supported by MultiTest.

Feature flagDescription
backtraceEnables backtrace feature in anyhow dependency.
stakingEnables staking feature in cosmwasm-std dependency and enables staking/distribution functionality in MultiTest library.
stargateEnables stargate feature in cosmwasm-std dependency and enables stargate/IBC functionality in MultiTest library.
cosmwasm_1_1Enables cosmwasm_1_1 feature in cosmwasm-std dependency.
cosmwasm_1_2Enables cosmwasm_1_2 feature in cosmwasm-std dependency and additionally cosmwasm_1_1 feature in MultiTest library.
cosmwasm_1_3Enables cosmwasm_1_3 feature in cosmwasm-std dependency and additionally cosmwasm_1_2 feature in MultiTest library.
cosmwasm_1_4Enables cosmwasm_1_4 feature in cosmwasm-std dependency and additionally cosmwasm_1_3 feature in MultiTest library.
cosmwasm_2_0Enables cosmwasm_2_0 feature in cosmwasm-std dependency and additionally cosmwasm_1_4 feature in MultiTest library.
cosmwasm_2_1Enables cosmwasm_2_1 feature in cosmwasm-std dependency and additionally cosmwasm_2_0 feature in MultiTest library.

Starting point

Usually, a good starting point when using MultiTest is the following dependency configuration in Cargo.toml file:

Cargo.toml
[dependencies]
cosmwasm-std = "2"
 
[dev-dependencies]
cw-multi-test = { version = "2", features = ["staking", "stargate", "cosmwasm_2_1"] }