global: utxos part 7

This commit is contained in:
nym21
2025-05-24 12:52:15 +02:00
parent 2883f88de6
commit 4ab10670c9
24 changed files with 4237 additions and 3385 deletions

View File

@@ -29,6 +29,7 @@ pub struct Dollars(f64);
impl Dollars {
pub const ZERO: Self = Self(0.0);
pub const NAN: Self = Self(f64::NAN);
pub const fn mint(dollars: f64) -> Self {
Self(dollars)

View File

@@ -45,8 +45,8 @@ impl OutputType {
Self::P2WSH => true,
Self::P2TR => true,
Self::P2A => true,
Self::Empty => false,
Self::Unknown => false,
Self::Empty => true,
Self::Unknown => true,
}
}

View File

@@ -42,6 +42,10 @@ impl Sats {
pub fn is_zero(&self) -> bool {
*self == Self::ZERO
}
pub fn is_not_zero(&self) -> bool {
*self != Self::ZERO
}
}
impl Add for Sats {
@@ -140,6 +144,12 @@ impl From<Sats> for f64 {
}
}
impl From<Sats> for usize {
fn from(value: Sats) -> Self {
value.0 as usize
}
}
impl From<Amount> for Sats {
fn from(value: Amount) -> Self {
Self(value.to_sat())