git: reset

This commit is contained in:
k
2024-06-23 17:38:53 +02:00
commit a1a576d088
375 changed files with 40952 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
use allocative::Allocative;
use super::WAmount;
#[derive(PartialEq, PartialOrd, Ord, Eq, Debug, Allocative)]
pub enum AddressSize {
Empty,
Plankton,
Shrimp,
Crab,
Fish,
Shark,
Whale,
Humpback,
Megalodon,
}
impl AddressSize {
pub fn from_amount(amount: WAmount) -> Self {
match amount.to_sat() {
0 => Self::Empty,
1..=9_999_999 => Self::Plankton,
10_000_000..=99_999_999 => Self::Shrimp,
100_000_000..=999_999_999 => Self::Crab,
1_000_000_000..=9_999_999_999 => Self::Fish,
10_000_000_000..=99_999_999_999 => Self::Shark,
100_000_000_000..=999_999_999_999 => Self::Whale,
1_000_000_000_000..=9_999_999_999_999 => Self::Humpback,
10_000_000_000_000..=u64::MAX => Self::Megalodon,
}
}
}