From bfba2a85ddaad6b366a7502cbda1ff2462dfd4c7 Mon Sep 17 00:00:00 2001 From: Shing Him Ng Date: Wed, 15 Jan 2025 23:21:14 -0600 Subject: [PATCH] Kill remaining mutants --- units/src/amount/tests.rs | 2 ++ units/src/fee_rate/mod.rs | 3 --- units/src/locktime/relative.rs | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/units/src/amount/tests.rs b/units/src/amount/tests.rs index 42a9e3d3c..df1785e54 100644 --- a/units/src/amount/tests.rs +++ b/units/src/amount/tests.rs @@ -972,10 +972,12 @@ fn sum_amounts() { assert_eq!([].iter().sum::(), SignedAmount::ZERO); let amounts = [sat(42), sat(1337), sat(21)]; + assert_eq!(amounts.iter().sum::(), sat(1400)); let sum = amounts.into_iter().sum::(); assert_eq!(sum, sat(1400)); let amounts = [ssat(-42), ssat(1337), ssat(21)]; + assert_eq!(amounts.iter().sum::(), ssat(1316)); let sum = amounts.into_iter().sum::(); assert_eq!(sum, ssat(1316)); } diff --git a/units/src/fee_rate/mod.rs b/units/src/fee_rate/mod.rs index c0baeb9df..f9dca7b87 100644 --- a/units/src/fee_rate/mod.rs +++ b/units/src/fee_rate/mod.rs @@ -69,9 +69,6 @@ impl FeeRate { pub const fn to_sat_per_vb_floor(self) -> u64 { self.0 / (1000 / 4) } /// Converts to sat/vB rounding up. - /// TODO: cargo-mutants will try to replace - with /, which results in 1000 / 4 / 1 which is also 250. - /// Since we're addressing the mutants before introducing the cargo-mutants workflow, come back later - /// and skip this function in the mutants.toml config file pub const fn to_sat_per_vb_ceil(self) -> u64 { (self.0 + (1000 / 4 - 1)) / (1000 / 4) } /// Checked multiplication. diff --git a/units/src/locktime/relative.rs b/units/src/locktime/relative.rs index 7a25d4906..7f8b4413a 100644 --- a/units/src/locktime/relative.rs +++ b/units/src/locktime/relative.rs @@ -116,8 +116,6 @@ impl Time { /// Returns the `u32` value used to encode this locktime in an nSequence field or /// argument to `OP_CHECKSEQUENCEVERIFY`. - /// TODO: Skip this in cargo-mutants. It will replace | with ^, which will return the same - /// value since the XOR is always taken against the u16 and an all-zero bitmask #[inline] pub const fn to_consensus_u32(self) -> u32 { (1u32 << 22) | self.0 as u32 // cast safety: u32 is wider than u16 on all architectures