Struct cosmwasm_vm::testing::MockApi
source · pub struct MockApi { /* private fields */ }
Expand description
Zero-pads all human addresses to make them fit the canonical_length and trims off zeros for the reverse operation. This is not really smart, but allows us to see a difference (and consistent length for canonical adddresses).
Implementations§
source§impl MockApi
impl MockApi
sourcepub fn canonical_length(&self) -> usize
pub fn canonical_length(&self) -> usize
Read-only getter for canonical_length
, which must not be changed by the caller.
pub fn new_failing(backend_error: &'static str) -> Self
Trait Implementations§
source§impl BackendApi for MockApi
impl BackendApi for MockApi
fn canonical_address(&self, input: &str) -> BackendResult<Vec<u8>>
fn human_address(&self, canonical: &[u8]) -> BackendResult<String>
impl Copy for MockApi
Auto Trait Implementations§
impl RefUnwindSafe for MockApi
impl Send for MockApi
impl Sync for MockApi
impl Unpin for MockApi
impl UnwindSafe for MockApi
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer