Skip to content

Commit 5179590

Browse files
committed
chore: add negative uint128 sub unwrap default test
1 parent b25469e commit 5179590

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

contracts/cw-ics20-latest/src/ibc_tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ mod test {
4646
assert_eq!(r#"{"error":"bad coin"}"#, fail_json.as_str());
4747
}
4848

49+
#[test]
50+
fn test_sub_negative() {
51+
assert_eq!(
52+
Uint128::from(10u128)
53+
.checked_sub(Uint128::from(11u128))
54+
.unwrap_or_default(),
55+
Uint128::from(0u128)
56+
)
57+
}
58+
4959
#[test]
5060
fn check_packet_json() {
5161
let packet = Ics20Packet::new(

0 commit comments

Comments
 (0)