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 272e881 commit 2d7b837Copy full SHA for 2d7b837
packages/std/src/testing/mock.rs
@@ -1217,8 +1217,18 @@ mod tests {
1217
#[test]
1218
fn addr_canonicalize_short_input() {
1219
let api = MockApi::default();
1220
- let human = String::from("cosmwasm1pj90vm");
1221
- assert_eq!(api.addr_canonicalize(&human).unwrap().to_string(), "");
+
+ // empty address should fail
1222
+ let empty = "cosmwasm1pj90vm";
1223
+ assert!(api
1224
+ .addr_canonicalize(empty)
1225
+ .unwrap_err()
1226
+ .to_string()
1227
+ .contains("Invalid canonical address length"));
1228
1229
+ // one byte address should work
1230
+ let human = "cosmwasm1qqvk2mde";
1231
+ assert_eq!(api.addr_canonicalize(human).unwrap().as_ref(), [0u8]);
1232
}
1233
1234
0 commit comments