Trait BackendApi

Source
pub trait BackendApi: Clone + Send {
    // Required methods
    fn addr_validate(&self, input: &str) -> BackendResult<()>;
    fn addr_canonicalize(&self, human: &str) -> BackendResult<Vec<u8>>;
    fn addr_humanize(&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.

Required Methods§

Source

fn addr_validate(&self, input: &str) -> BackendResult<()>

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§