Skip to content

Commit

Permalink
Change method return type
Browse files Browse the repository at this point in the history
Both SignedAmount and Amount now have the same range.  That is, MIN/MAX
of both SignedAmount and Amount are the same.  Therefore conversion
between the two can no longer fail due to a difference in range.  This
change removes this range check since it's obsolete.
  • Loading branch information
yancyribbens committed Dec 14, 2024
1 parent 834010d commit 1276cd8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 46 deletions.
12 changes: 5 additions & 7 deletions api/units/all-features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::relative::Height
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::relative::Time
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::weight::Weight
impl core::convert::TryFrom<bitcoin_units::Amount> for bitcoin_units::SignedAmount
impl core::convert::TryFrom<bitcoin_units::SignedAmount> for bitcoin_units::Amount
impl core::convert::TryFrom<bitcoin_units::block::BlockHeight> for bitcoin_units::locktime::absolute::Height
impl core::convert::TryFrom<bitcoin_units::block::BlockInterval> for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::Amount
impl core::default::Default for bitcoin_units::SignedAmount
impl core::default::Default for bitcoin_units::block::BlockInterval
impl core::default::Default for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::locktime::relative::Time
impl core::error::Error for bitcoin_units::amount::error::InputTooLargeError
Expand Down Expand Up @@ -737,7 +737,6 @@ pub const fn bitcoin_units::weight::Weight::from_vb_unchecked(vb: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_vb_unwrap(vb: u64) -> bitcoin_units::weight::Weight
pub const fn bitcoin_units::weight::Weight::from_witness_data_size(witness_size: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu(wu: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu_usize(wu: usize) -> Self
pub const fn bitcoin_units::weight::Weight::to_kwu_floor(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_ceil(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_floor(self) -> u64
Expand Down Expand Up @@ -788,7 +787,7 @@ pub fn bitcoin_units::Amount::sum<I: core::iter::traits::iterator::Iterator<Item
pub fn bitcoin_units::Amount::sum<I>(iter: I) -> Self where I: core::iter::traits::iterator::Iterator<Item = &'a bitcoin_units::Amount>
pub fn bitcoin_units::Amount::to_btc(self) -> f64
pub fn bitcoin_units::Amount::to_float_in(self, denom: bitcoin_units::amount::Denomination) -> f64
pub fn bitcoin_units::Amount::to_signed(self) -> core::result::Result<bitcoin_units::SignedAmount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::Amount::to_signed(self) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::Amount::to_string_in(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::Amount::to_string_with_denomination(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::Amount::try_from(value: bitcoin_units::SignedAmount) -> core::result::Result<Self, Self::Error>
Expand Down Expand Up @@ -843,7 +842,6 @@ pub fn bitcoin_units::SignedAmount::to_float_in(self, denom: bitcoin_units::amou
pub fn bitcoin_units::SignedAmount::to_string_in(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::SignedAmount::to_string_with_denomination(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::SignedAmount::to_unsigned(self) -> core::result::Result<bitcoin_units::Amount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::SignedAmount::try_from(value: bitcoin_units::Amount) -> core::result::Result<Self, Self::Error>
pub fn bitcoin_units::SignedAmount::type_prefix(_: private::Token) -> &'static str
pub fn bitcoin_units::SignedAmount::unchecked_add(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::SignedAmount::unchecked_sub(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
Expand Down Expand Up @@ -956,6 +954,7 @@ pub fn bitcoin_units::block::BlockInterval::add(self, rhs: bitcoin_units::block:
pub fn bitcoin_units::block::BlockInterval::add_assign(&mut self, rhs: bitcoin_units::block::BlockInterval)
pub fn bitcoin_units::block::BlockInterval::clone(&self) -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::cmp(&self, other: &bitcoin_units::block::BlockInterval) -> core::cmp::Ordering
pub fn bitcoin_units::block::BlockInterval::default() -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::deserialize<__D>(__deserializer: __D) -> core::result::Result<Self, <__D as serde::de::Deserializer>::Error> where __D: serde::de::Deserializer<'de>
pub fn bitcoin_units::block::BlockInterval::eq(&self, other: &bitcoin_units::block::BlockInterval) -> bool
pub fn bitcoin_units::block::BlockInterval::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
Expand Down Expand Up @@ -1191,17 +1190,16 @@ pub struct bitcoin_units::locktime::relative::TimeOverflowError
pub struct bitcoin_units::parse::PrefixedHexError(_)
pub struct bitcoin_units::parse::UnprefixedHexError(_)
pub struct bitcoin_units::weight::Weight(_)
pub trait bitcoin_units::amount::CheckedSum<R>: private::SumSeal<R>
pub trait bitcoin_units::amount::CheckedSum<R>: sealed::Sealed<R>
pub trait bitcoin_units::amount::serde::SerdeAmount: core::marker::Copy + core::marker::Sized
pub trait bitcoin_units::amount::serde::SerdeAmountForOpt: core::marker::Copy + core::marker::Sized + bitcoin_units::amount::serde::SerdeAmount
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized + sealed::Sealed
pub type &bitcoin_units::fee_rate::FeeRate::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::Amount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::Amount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::Amount::Output = bitcoin_units::Amount
pub type bitcoin_units::Amount::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::SignedAmount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::SignedAmount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::SignedAmount::Output = bitcoin_units::SignedAmount
pub type bitcoin_units::amount::Denomination::Err = bitcoin_units::amount::error::ParseDenominationError
pub type bitcoin_units::block::BlockHeight::Err = bitcoin_units::parse::ParseIntError
Expand Down
12 changes: 5 additions & 7 deletions api/units/alloc-only.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::relative::Height
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::locktime::relative::Time
impl core::convert::TryFrom<alloc::string::String> for bitcoin_units::weight::Weight
impl core::convert::TryFrom<bitcoin_units::Amount> for bitcoin_units::SignedAmount
impl core::convert::TryFrom<bitcoin_units::SignedAmount> for bitcoin_units::Amount
impl core::convert::TryFrom<bitcoin_units::block::BlockHeight> for bitcoin_units::locktime::absolute::Height
impl core::convert::TryFrom<bitcoin_units::block::BlockInterval> for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::Amount
impl core::default::Default for bitcoin_units::SignedAmount
impl core::default::Default for bitcoin_units::block::BlockInterval
impl core::default::Default for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::locktime::relative::Time
impl core::fmt::Debug for bitcoin_units::Amount
Expand Down Expand Up @@ -695,7 +695,6 @@ pub const fn bitcoin_units::weight::Weight::from_vb_unchecked(vb: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_vb_unwrap(vb: u64) -> bitcoin_units::weight::Weight
pub const fn bitcoin_units::weight::Weight::from_witness_data_size(witness_size: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu(wu: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu_usize(wu: usize) -> Self
pub const fn bitcoin_units::weight::Weight::to_kwu_floor(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_ceil(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_floor(self) -> u64
Expand Down Expand Up @@ -736,7 +735,7 @@ pub fn bitcoin_units::Amount::sum<I: core::iter::traits::iterator::Iterator<Item
pub fn bitcoin_units::Amount::sum<I>(iter: I) -> Self where I: core::iter::traits::iterator::Iterator<Item = &'a bitcoin_units::Amount>
pub fn bitcoin_units::Amount::to_btc(self) -> f64
pub fn bitcoin_units::Amount::to_float_in(self, denom: bitcoin_units::amount::Denomination) -> f64
pub fn bitcoin_units::Amount::to_signed(self) -> core::result::Result<bitcoin_units::SignedAmount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::Amount::to_signed(self) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::Amount::to_string_in(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::Amount::to_string_with_denomination(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::Amount::try_from(value: bitcoin_units::SignedAmount) -> core::result::Result<Self, Self::Error>
Expand Down Expand Up @@ -780,7 +779,6 @@ pub fn bitcoin_units::SignedAmount::to_float_in(self, denom: bitcoin_units::amou
pub fn bitcoin_units::SignedAmount::to_string_in(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::SignedAmount::to_string_with_denomination(self, denom: bitcoin_units::amount::Denomination) -> alloc::string::String
pub fn bitcoin_units::SignedAmount::to_unsigned(self) -> core::result::Result<bitcoin_units::Amount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::SignedAmount::try_from(value: bitcoin_units::Amount) -> core::result::Result<Self, Self::Error>
pub fn bitcoin_units::SignedAmount::unchecked_add(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::SignedAmount::unchecked_sub(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::SignedAmount::unsigned_abs(self) -> bitcoin_units::Amount
Expand Down Expand Up @@ -863,6 +861,7 @@ pub fn bitcoin_units::block::BlockInterval::add(self, rhs: bitcoin_units::block:
pub fn bitcoin_units::block::BlockInterval::add_assign(&mut self, rhs: bitcoin_units::block::BlockInterval)
pub fn bitcoin_units::block::BlockInterval::clone(&self) -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::cmp(&self, other: &bitcoin_units::block::BlockInterval) -> core::cmp::Ordering
pub fn bitcoin_units::block::BlockInterval::default() -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::eq(&self, other: &bitcoin_units::block::BlockInterval) -> bool
pub fn bitcoin_units::block::BlockInterval::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_units::block::BlockInterval::from(h: bitcoin_units::locktime::relative::Height) -> Self
Expand Down Expand Up @@ -1069,15 +1068,14 @@ pub struct bitcoin_units::locktime::relative::TimeOverflowError
pub struct bitcoin_units::parse::PrefixedHexError(_)
pub struct bitcoin_units::parse::UnprefixedHexError(_)
pub struct bitcoin_units::weight::Weight(_)
pub trait bitcoin_units::amount::CheckedSum<R>: private::SumSeal<R>
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized
pub trait bitcoin_units::amount::CheckedSum<R>: sealed::Sealed<R>
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized + sealed::Sealed
pub type &bitcoin_units::fee_rate::FeeRate::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::Amount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::Amount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::Amount::Output = bitcoin_units::Amount
pub type bitcoin_units::Amount::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::SignedAmount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::SignedAmount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::SignedAmount::Output = bitcoin_units::SignedAmount
pub type bitcoin_units::amount::Denomination::Err = bitcoin_units::amount::error::ParseDenominationError
pub type bitcoin_units::block::BlockHeight::Err = bitcoin_units::parse::ParseIntError
Expand Down
12 changes: 5 additions & 7 deletions api/units/no-features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ impl core::convert::TryFrom<&str> for bitcoin_units::locktime::absolute::Time
impl core::convert::TryFrom<&str> for bitcoin_units::locktime::relative::Height
impl core::convert::TryFrom<&str> for bitcoin_units::locktime::relative::Time
impl core::convert::TryFrom<&str> for bitcoin_units::weight::Weight
impl core::convert::TryFrom<bitcoin_units::Amount> for bitcoin_units::SignedAmount
impl core::convert::TryFrom<bitcoin_units::SignedAmount> for bitcoin_units::Amount
impl core::convert::TryFrom<bitcoin_units::block::BlockHeight> for bitcoin_units::locktime::absolute::Height
impl core::convert::TryFrom<bitcoin_units::block::BlockInterval> for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::Amount
impl core::default::Default for bitcoin_units::SignedAmount
impl core::default::Default for bitcoin_units::block::BlockInterval
impl core::default::Default for bitcoin_units::locktime::relative::Height
impl core::default::Default for bitcoin_units::locktime::relative::Time
impl core::fmt::Debug for bitcoin_units::Amount
Expand Down Expand Up @@ -677,7 +677,6 @@ pub const fn bitcoin_units::weight::Weight::from_vb_unchecked(vb: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_vb_unwrap(vb: u64) -> bitcoin_units::weight::Weight
pub const fn bitcoin_units::weight::Weight::from_witness_data_size(witness_size: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu(wu: u64) -> Self
pub const fn bitcoin_units::weight::Weight::from_wu_usize(wu: usize) -> Self
pub const fn bitcoin_units::weight::Weight::to_kwu_floor(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_ceil(self) -> u64
pub const fn bitcoin_units::weight::Weight::to_vbytes_floor(self) -> u64
Expand Down Expand Up @@ -714,7 +713,7 @@ pub fn bitcoin_units::Amount::sub(self, rhs: bitcoin_units::Amount) -> Self::Out
pub fn bitcoin_units::Amount::sub_assign(&mut self, other: bitcoin_units::Amount)
pub fn bitcoin_units::Amount::sum<I: core::iter::traits::iterator::Iterator<Item = Self>>(iter: I) -> Self
pub fn bitcoin_units::Amount::sum<I>(iter: I) -> Self where I: core::iter::traits::iterator::Iterator<Item = &'a bitcoin_units::Amount>
pub fn bitcoin_units::Amount::to_signed(self) -> core::result::Result<bitcoin_units::SignedAmount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::Amount::to_signed(self) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::Amount::try_from(value: bitcoin_units::SignedAmount) -> core::result::Result<Self, Self::Error>
pub fn bitcoin_units::Amount::unchecked_add(self, rhs: bitcoin_units::Amount) -> bitcoin_units::Amount
pub fn bitcoin_units::Amount::unchecked_sub(self, rhs: bitcoin_units::Amount) -> bitcoin_units::Amount
Expand Down Expand Up @@ -750,7 +749,6 @@ pub fn bitcoin_units::SignedAmount::sub_assign(&mut self, other: bitcoin_units::
pub fn bitcoin_units::SignedAmount::sum<I: core::iter::traits::iterator::Iterator<Item = Self>>(iter: I) -> Self
pub fn bitcoin_units::SignedAmount::sum<I>(iter: I) -> Self where I: core::iter::traits::iterator::Iterator<Item = &'a bitcoin_units::SignedAmount>
pub fn bitcoin_units::SignedAmount::to_unsigned(self) -> core::result::Result<bitcoin_units::Amount, bitcoin_units::amount::error::OutOfRangeError>
pub fn bitcoin_units::SignedAmount::try_from(value: bitcoin_units::Amount) -> core::result::Result<Self, Self::Error>
pub fn bitcoin_units::SignedAmount::unchecked_add(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::SignedAmount::unchecked_sub(self, rhs: bitcoin_units::SignedAmount) -> bitcoin_units::SignedAmount
pub fn bitcoin_units::SignedAmount::unsigned_abs(self) -> bitcoin_units::Amount
Expand Down Expand Up @@ -831,6 +829,7 @@ pub fn bitcoin_units::block::BlockInterval::add(self, rhs: bitcoin_units::block:
pub fn bitcoin_units::block::BlockInterval::add_assign(&mut self, rhs: bitcoin_units::block::BlockInterval)
pub fn bitcoin_units::block::BlockInterval::clone(&self) -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::cmp(&self, other: &bitcoin_units::block::BlockInterval) -> core::cmp::Ordering
pub fn bitcoin_units::block::BlockInterval::default() -> bitcoin_units::block::BlockInterval
pub fn bitcoin_units::block::BlockInterval::eq(&self, other: &bitcoin_units::block::BlockInterval) -> bool
pub fn bitcoin_units::block::BlockInterval::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
pub fn bitcoin_units::block::BlockInterval::from(h: bitcoin_units::locktime::relative::Height) -> Self
Expand Down Expand Up @@ -1023,15 +1022,14 @@ pub struct bitcoin_units::locktime::relative::TimeOverflowError
pub struct bitcoin_units::parse::PrefixedHexError(_)
pub struct bitcoin_units::parse::UnprefixedHexError(_)
pub struct bitcoin_units::weight::Weight(_)
pub trait bitcoin_units::amount::CheckedSum<R>: private::SumSeal<R>
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized
pub trait bitcoin_units::amount::CheckedSum<R>: sealed::Sealed<R>
pub trait bitcoin_units::parse::Integer: core::str::traits::FromStr<Err = core::num::error::ParseIntError> + core::convert::TryFrom<i8> + core::marker::Sized + sealed::Sealed
pub type &bitcoin_units::fee_rate::FeeRate::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::Amount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::Amount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::Amount::Output = bitcoin_units::Amount
pub type bitcoin_units::Amount::Output = bitcoin_units::fee_rate::FeeRate
pub type bitcoin_units::SignedAmount::Err = bitcoin_units::amount::error::ParseError
pub type bitcoin_units::SignedAmount::Error = bitcoin_units::amount::error::OutOfRangeError
pub type bitcoin_units::SignedAmount::Output = bitcoin_units::SignedAmount
pub type bitcoin_units::amount::Denomination::Err = bitcoin_units::amount::error::ParseDenominationError
pub type bitcoin_units::block::BlockHeight::Err = bitcoin_units::parse::ParseIntError
Expand Down
6 changes: 3 additions & 3 deletions bitcoin/src/blockdata/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,8 @@ pub fn effective_value(
value: Amount,
) -> Option<SignedAmount> {
let weight = satisfaction_weight.checked_add(TX_IN_BASE_WEIGHT)?;
let signed_input_fee = fee_rate.checked_mul_by_weight(weight)?.to_signed().ok()?;
value.to_signed().ok()?.checked_sub(signed_input_fee)
let signed_input_fee = fee_rate.checked_mul_by_weight(weight)?.to_signed();
value.to_signed().checked_sub(signed_input_fee)
}

/// Predicts the weight of a to-be-constructed transaction.
Expand Down Expand Up @@ -1673,7 +1673,7 @@ mod tests {

// 10 sat/kwu * (204wu + BASE_WEIGHT) = 4 sats
let expected_fee = "4 sats".parse::<SignedAmount>().unwrap();
let expected_effective_value = value.to_signed().unwrap() - expected_fee;
let expected_effective_value = value.to_signed() - expected_fee;
assert_eq!(effective_value, expected_effective_value);
}

Expand Down
6 changes: 0 additions & 6 deletions units/src/amount/signed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,6 @@ impl FromStr for SignedAmount {
}
}

impl TryFrom<Amount> for SignedAmount {
type Error = OutOfRangeError;

fn try_from(value: Amount) -> Result<Self, Self::Error> { value.to_signed() }
}

impl core::iter::Sum for SignedAmount {
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self {
let sats: i64 = iter.map(|amt| amt.0).sum();
Expand Down
Loading

0 comments on commit 1276cd8

Please sign in to comment.