[][src]Trait cosmwasm_std::Api

pub trait Api: Copy + Clone + Send {
    fn canonical_address(&self, human: &HumanAddr) -> StdResult<CanonicalAddr>;
fn human_address(&self, canonical: &CanonicalAddr) -> StdResult<HumanAddr>; }

Api are 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

Loading content...

Implementors

Loading content...