Expand description
cosmwasm_std::Addr
<->cosmwasm_std::CanonicalAddr
conversion for types that contain addresses.
Traits
- The trait that represents any type which contains a
cosmwasm_std::Addr
and needs to be stored sincecosmwasm_std::Addr
is usually converted tocosmwasm_std::CanonicalAddr
first. The trait must be implemented on the non-canonical version of the type and the output ofCanonize::canonize
must return the canonical version of the same type which is represented by its sister traitHumanize
. This relationship is enforced on the type level sinceCanonize::Output
must implementHumanize
and vice versa. - The trait that represents the canonical version of the given type. See
Canonize
for more info.
Functions
- Attempting to canonicalize an empty address will fail. This function skips calling
cosmwasm_std::Api::addr_canonicalize
if the input is empty and returnsCanonicalAddr::default()
instead. - Attempting to humanize an empty address will fail. This function skips calling
cosmwasm_std::Api::addr_humanize
if the input is empty and returnsAddr::default()
instead. - Validates a collection of strings that are expected to be valid addresses.