Kill remaining mutants

This commit is contained in:
Shing Him Ng 2025-01-15 23:21:14 -06:00
parent 871fa08f61
commit bfba2a85dd
3 changed files with 2 additions and 5 deletions

View File

@ -972,10 +972,12 @@ fn sum_amounts() {
assert_eq!([].iter().sum::<SignedAmount>(), SignedAmount::ZERO);
let amounts = [sat(42), sat(1337), sat(21)];
assert_eq!(amounts.iter().sum::<Amount>(), sat(1400));
let sum = amounts.into_iter().sum::<Amount>();
assert_eq!(sum, sat(1400));
let amounts = [ssat(-42), ssat(1337), ssat(21)];
assert_eq!(amounts.iter().sum::<SignedAmount>(), ssat(1316));
let sum = amounts.into_iter().sum::<SignedAmount>();
assert_eq!(sum, ssat(1316));
}

View File

@ -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.

View File

@ -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