units: Fix panic message

Recently I wrote a panic message that included the maximum value of an
integer however I used the max of a 16 bit value for both signed and
unsigned - this is incorrect.

Use the correct values for `u16::MAX` and `i16::MAX`.
This commit is contained in:
Tobin C. Harding 2025-03-19 13:58:12 +11:00
parent f7006e3d15
commit 6c614d9320
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ impl SignedAmount {
match Self::from_sat(sats) { match Self::from_sat(sats) {
Ok(amount) => amount, Ok(amount) => amount,
Err(_) => panic!("unreachable - 65536 BTC is within range"), Err(_) => panic!("unreachable - 32,767 BTC is within range"),
} }
} }

View File

@ -152,7 +152,7 @@ impl Amount {
match Self::from_sat(sats) { match Self::from_sat(sats) {
Ok(amount) => amount, Ok(amount) => amount,
Err(_) => panic!("unreachable - 65536 BTC is within range"), Err(_) => panic!("unreachable - 65,535 BTC is within range"),
} }
} }