diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs index b2a0dfac45..b04a70a9ea 100644 --- a/units/src/amount/tests.rs +++ b/units/src/amount/tests.rs @@ -624,12 +624,12 @@ fn to_from_string_in() { assert_eq!(sa_str(&sa_sat(-1).to_string_in(D::MicroBitcoin), D::MicroBitcoin), Ok(sa_sat(-1))); assert_eq!( - sa_str(&sa_sat(i64::MAX).to_string_in(D::Satoshi), D::MicroBitcoin), + sa_str(&SignedAmount::MAX.to_string_in(D::Satoshi), D::MicroBitcoin), Err(OutOfRangeError::too_big(true).into()) ); // Test an overflow bug in `abs()` assert_eq!( - sa_str(&sa_sat(i64::MIN).to_string_in(D::Satoshi), D::MicroBitcoin), + sa_str(&SignedAmount::MIN.to_string_in(D::Satoshi), D::MicroBitcoin), Err(OutOfRangeError::too_small().into()) ); } @@ -903,12 +903,12 @@ fn checked_sum_amounts() { assert_eq!(None, sum); let amounts = - [SignedAmount::from_sat(i64::MIN), SignedAmount::from_sat(-1), SignedAmount::from_sat(21)]; + [SignedAmount::MIN, SignedAmount::from_sat(-1), SignedAmount::from_sat(21)]; let sum = amounts.into_iter().checked_sum(); assert_eq!(None, sum); let amounts = - [SignedAmount::from_sat(i64::MAX), SignedAmount::from_sat(1), SignedAmount::from_sat(21)]; + [SignedAmount::MAX, SignedAmount::from_sat(1), SignedAmount::from_sat(21)]; let sum = amounts.into_iter().checked_sum(); assert_eq!(None, sum);