Skip to content

Commit 2d7b837

Browse files
committed
Fix std tests
1 parent 272e881 commit 2d7b837

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

packages/std/src/testing/mock.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,8 +1217,18 @@ mod tests {
12171217
#[test]
12181218
fn addr_canonicalize_short_input() {
12191219
let api = MockApi::default();
1220-
let human = String::from("cosmwasm1pj90vm");
1221-
assert_eq!(api.addr_canonicalize(&human).unwrap().to_string(), "");
1220+
1221+
// 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]);
12221232
}
12231233

12241234
#[test]

0 commit comments

Comments
 (0)