Rarity::Epic ); assert_eq!( Sat(50 * COIN_VALUE * u64::from(SUBSIDY_HALVING_INTERVAL) + 1).rarity(), Rarity::Common ); assert_eq!(Sat(2067187500000000 - 1).rarity(), Rarity::Common); assert_eq!(Sat(2067187500000000).rarity(), Rarity::Legendary); assert_eq!(Sat(2067187500000000 + 1).rarity(), Rarity::Common); } #[test] fn from_str_and_deserialize_ok() { #[track_caller] fn case(s: &str, expected: Rarity) { let actual = s.parse::<Rarity>().unwrap(); assert_eq!(actual, expected); let round_trip = actual.to_string().parse::<Rarity>().unwrap(); assert_eq!(round_trip, expected); let serialized = serde_json::to_string(&expected).unwrap(); assert!(serde_json::from_str::<Rarity>(&serialized).is_ok()); } case("common", Rarity::Common); case("uncommon", Rarity::Uncommon); case("rare", Rarity::Rare); case("epic", Rarity::Epic); case("legendary", Rarity::Legendary); case("mythic", Rarity::Mythic); }
Inscription number 44,981,389
Genesis block 819,057
File type text
File size 1 KB
Creation date Nov 30,2023 1:16 am