Skip to content

Commit

Permalink
Added one additional BigInt=>u128 test.
Browse files Browse the repository at this point in the history
  • Loading branch information
oskin1 committed Aug 30, 2024
1 parent 78ad394 commit 39c28ce
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion chain/rust/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ mod tests {

#[test]
fn bigint_uint_u128_roundtrip() {
let int = u64::MAX;
let int = 462_164_030_739_157_517;
let x = BigInteger::from_int(&Int::Uint {
value: int,
encoding: None,
Expand All @@ -1067,6 +1067,16 @@ mod tests {
assert_eq!(x.as_u128(), Some(int as u128))
}

#[test]
fn bigint_uint_u128_roundtrip_max() {
let int = u64::MAX;
let x = BigInteger::from_int(&Int::Uint {
value: int,
encoding: None,
});
assert_eq!(x.as_u128(), Some(int as u128))
}

#[test]
fn bigint_uint_u128_min() {
let bytes = [0x00];
Expand Down

0 comments on commit 39c28ce

Please sign in to comment.