Kill remaining mutants
This commit is contained in:
parent
871fa08f61
commit
bfba2a85dd
|
@ -972,10 +972,12 @@ fn sum_amounts() {
|
||||||
assert_eq!([].iter().sum::<SignedAmount>(), SignedAmount::ZERO);
|
assert_eq!([].iter().sum::<SignedAmount>(), SignedAmount::ZERO);
|
||||||
|
|
||||||
let amounts = [sat(42), sat(1337), sat(21)];
|
let amounts = [sat(42), sat(1337), sat(21)];
|
||||||
|
assert_eq!(amounts.iter().sum::<Amount>(), sat(1400));
|
||||||
let sum = amounts.into_iter().sum::<Amount>();
|
let sum = amounts.into_iter().sum::<Amount>();
|
||||||
assert_eq!(sum, sat(1400));
|
assert_eq!(sum, sat(1400));
|
||||||
|
|
||||||
let amounts = [ssat(-42), ssat(1337), ssat(21)];
|
let amounts = [ssat(-42), ssat(1337), ssat(21)];
|
||||||
|
assert_eq!(amounts.iter().sum::<SignedAmount>(), ssat(1316));
|
||||||
let sum = amounts.into_iter().sum::<SignedAmount>();
|
let sum = amounts.into_iter().sum::<SignedAmount>();
|
||||||
assert_eq!(sum, ssat(1316));
|
assert_eq!(sum, ssat(1316));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,9 +69,6 @@ impl FeeRate {
|
||||||
pub const fn to_sat_per_vb_floor(self) -> u64 { self.0 / (1000 / 4) }
|
pub const fn to_sat_per_vb_floor(self) -> u64 { self.0 / (1000 / 4) }
|
||||||
|
|
||||||
/// Converts to sat/vB rounding up.
|
/// 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) }
|
pub const fn to_sat_per_vb_ceil(self) -> u64 { (self.0 + (1000 / 4 - 1)) / (1000 / 4) }
|
||||||
|
|
||||||
/// Checked multiplication.
|
/// Checked multiplication.
|
||||||
|
|
|
@ -116,8 +116,6 @@ impl Time {
|
||||||
|
|
||||||
/// Returns the `u32` value used to encode this locktime in an nSequence field or
|
/// Returns the `u32` value used to encode this locktime in an nSequence field or
|
||||||
/// argument to `OP_CHECKSEQUENCEVERIFY`.
|
/// 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]
|
#[inline]
|
||||||
pub const fn to_consensus_u32(self) -> u32 {
|
pub const fn to_consensus_u32(self) -> u32 {
|
||||||
(1u32 << 22) | self.0 as u32 // cast safety: u32 is wider than u16 on all architectures
|
(1u32 << 22) | self.0 as u32 // cast safety: u32 is wider than u16 on all architectures
|
||||||
|
|
Loading…
Reference in New Issue