Crate cosmwasm_vm

Source

Modules§

testing

Structs§

AnalysisReport
Backend
Holds all external dependencies of the contract. Designed to allow easy dependency injection at runtime. This cannot be copied or cloned since it would behave differently for mock storages and a bridge storage in the VM.
Cache
CacheOptions
Config
Various configurations for the VM.
DebugInfo
Additional environmental information in a debug call.
GasInfo
A structure that represents gas cost to be deducted from the remaining gas. This is always needed when computations are performed outside of Wasm execution, such as calling crypto APIs or calls into the blockchain.
GasReport
Instance
InstanceOptions
Metrics
PerModuleMetrics
PinnedMetrics
Size
Stats
Statistics about the usage of a cache instance. Those values are node specific and must not be used in a consensus critical context. When a node is hit by a client for simulations or other queries, hits and misses increase. Also a node restart will reset the values.
WasmLimits
Limits for static validation of Wasm files. These are checked before storing the Wasm file. All limits are optional because they are coming from the Go-side and have default values.

Enums§

BackendError
CommunicationError
An error in the communication between contract and host. Those happen around imports and exports.
RegionValidationError
An error validating a Region
VmError

Traits§

BackendApi
Callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.
Querier
Storage
Access to the VM’s backend storage, i.e. the chain

Functions§

call_execute
call_execute_raw
Calls Wasm export “execute” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
call_ibc_destination_callback
call_ibc_destination_callback_raw
call_ibc_source_callback
call_ibc_source_callback_raw
call_instantiate
call_instantiate_raw
Calls Wasm export “instantiate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
call_migrate
call_migrate_raw
Calls Wasm export “migrate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
call_migrate_with_info
call_migrate_with_info_raw
Calls Wasm export “migrate” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked. The difference between this function and call_migrate_raw is the additional argument - migrate_info. It contains additional data related to the contract’s migration procedure.
call_query
call_query_raw
Calls Wasm export “query” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
call_reply
call_reply_raw
Calls Wasm export “reply” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
call_sudo
call_sudo_raw
Calls Wasm export “sudo” and returns raw data from the contract. The result is length limited to prevent abuse but otherwise unchecked.
capabilities_from_csv
Takes a comma-separated string, splits it by commas, removes empty elements and returns a set of capabilities. This can be used e.g. to initialize the cache.
from_slice
Deserializes JSON data into a document of type T.
to_vec

Type Aliases§

BackendResult
A result type for calling into the backend. Such a call can cause non-negligible computational cost in both success and failure case and must always have gas information attached.
CommunicationResult
RegionValidationResult
VmResult