Fix mutants in units

Cargo mutant found missed mutants in the bitcoin consts in both signed
and unsigned amounts.

Add a test to check their values.
This commit is contained in:
Jamil Lambert, PhD 2025-01-23 12:14:16 +00:00
parent 67f3d498af
commit 420e8c043e
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
1 changed files with 9 additions and 0 deletions

View File

@ -1230,3 +1230,12 @@ fn signed_sub_assign() {
f -= &ssat(2);
assert_eq!(f, ssat(1));
}
#[test]
fn check_const() {
assert_eq!(SignedAmount::ONE_BTC.to_sat(), 100_000_000);
assert_eq!(Amount::ONE_BTC.to_sat(), 100_000_000);
assert_eq!(SignedAmount::FIFTY_BTC.to_sat(), SignedAmount::ONE_BTC.to_sat() * 50);
assert_eq!(Amount::FIFTY_BTC.to_sat(), Amount::ONE_BTC.to_sat() * 50);
assert_eq!(Amount::MAX_MONEY.to_sat() as i64, SignedAmount::MAX_MONEY.to_sat());
}