Use sats instead of satoshi

No one says that, just use `sats`.

Internal change only.
This commit is contained in:
Tobin C. Harding 2025-01-24 11:36:32 +11:00
parent 00b71a670f
commit 34e3049ae0
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 3 additions and 3 deletions

View File

@ -152,19 +152,19 @@ impl Amount {
///
/// If the amount is too big, too precise or negative.
pub fn from_str_in(s: &str, denom: Denomination) -> Result<Amount, ParseAmountError> {
let (negative, satoshi) =
let (negative, sats) =
parse_signed_to_satoshi(s, denom).map_err(|error| error.convert(false))?;
if negative {
return Err(ParseAmountError(ParseAmountErrorInner::OutOfRange(
OutOfRangeError::negative(),
)));
}
if satoshi > Self::MAX.0 {
if sats > Self::MAX.0 {
return Err(ParseAmountError(ParseAmountErrorInner::OutOfRange(
OutOfRangeError::too_big(false),
)));
}
Ok(Amount::from_sat(satoshi))
Ok(Amount::from_sat(sats))
}
/// Parses amounts with denomination suffix as produced by [`Self::to_string_with_denomination`]