amount: stop using from_sat_unchecked in tests

There is no need for this. It's a 2-line diff to change it.
This commit is contained in:
Andrew Poelstra 2025-03-18 13:38:36 +00:00
parent 05c8b043ff
commit 3370c14d74
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 2 additions and 2 deletions

View File

@ -648,9 +648,9 @@ fn from_str() {
fn to_from_string_in() { fn to_from_string_in() {
use super::Denomination as D; use super::Denomination as D;
let ua_str = Amount::from_str_in; let ua_str = Amount::from_str_in;
let ua_sat = Amount::from_sat_unchecked; let ua_sat = |n| Amount::from_sat(n).unwrap();
let sa_str = SignedAmount::from_str_in; let sa_str = SignedAmount::from_str_in;
let sa_sat = SignedAmount::from_sat_unchecked; let sa_sat = |n| SignedAmount::from_sat(n).unwrap();
assert_eq!("0.5", ua_sat(50).to_string_in(D::Bit)); assert_eq!("0.5", ua_sat(50).to_string_in(D::Bit));
assert_eq!("-0.5", sa_sat(-50).to_string_in(D::Bit)); assert_eq!("-0.5", sa_sat(-50).to_string_in(D::Bit));