We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f00b39d commit 005d863Copy full SHA for 005d863
packages/std/src/testing/mock.rs
@@ -139,14 +139,14 @@ impl Api for MockApi {
139
140
fn addr_humanize(&self, canonical: &CanonicalAddr) -> StdResult<Addr> {
141
validate_length(canonical.as_ref())?;
142
- let Ok(encoded) = encode(
+
143
+ encode(
144
self.bech32_prefix,
145
canonical.as_slice().to_base32(),
146
Variant::Bech32,
- ) else {
147
- return Err(StdError::generic_err("Invalid canonical address"));
148
- };
149
- Ok(Addr::unchecked(encoded))
+ )
+ .map(Addr::unchecked)
+ .map_err(|_| StdError::generic_err("Invalid canonical address"))
150
}
151
152
fn secp256k1_verify(
0 commit comments