Trait cosmwasm_vm::BackendApi

source ·
pub trait BackendApi: Copy + Clone + Send {
    // Required methods
    fn canonical_address(&self, human: &str) -> BackendResult<Vec<u8>>;
    fn human_address(&self, canonical: &[u8]) -> BackendResult<String>;
}
Expand description

Callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.

Currently it just supports address conversion, we could add eg. crypto functions here. These should all be pure (stateless) functions. If you need state, you probably want to use the Querier.

We can use feature flags to opt-in to non-essential methods for backwards compatibility in systems that don’t have them all.

Required Methods§

source

fn canonical_address(&self, human: &str) -> BackendResult<Vec<u8>>

source

fn human_address(&self, canonical: &[u8]) -> BackendResult<String>

Object Safety§

This trait is not object safe.

Implementors§