Merge rust-bitcoin/rust-bitcoin#4054: Kill mutants found by github-actions
854a4cf511
Kill mutant in checked_mul_by_fee_rate (Jamil Lambert, PhD)44df39e72c
Skip deprecated functions in mutants.toml (Jamil Lambert, PhD) Pull request description: Recent changes to units created new mutants. Skip mutants from deprecated functions. Modify existing test to kill `checked_mul_by_fee_rate` mutant. Close #4026 ACKs for top commit: tcharding: ACK854a4cf511
apoelstra: ACK 854a4cf51189b4be596c4f048420fc9b1212d714; successfully ran local tests Tree-SHA512: 62343984d16d7a6f2287454a21c4ec5333387c940ce97819c2610da08f709ba3e806e024dc2f352e309b4ed5555c13e7b02fdf0c41aae5961f0e0c3c35d049a3
This commit is contained in:
commit
0000bdb609
|
@ -19,6 +19,8 @@ exclude_re = [
|
||||||
"dec_width", # Replacing num /= 10 with num %=10 in a loop causes a timeout due to infinite loop
|
"dec_width", # Replacing num /= 10 with num %=10 in a loop causes a timeout due to infinite loop
|
||||||
# src/locktime/relative.rs
|
# src/locktime/relative.rs
|
||||||
"Time::to_consensus_u32", # Mutant from replacing | with ^, this returns the same value since the XOR is taken against the u16 with an all-zero bitmask
|
"Time::to_consensus_u32", # Mutant from replacing | with ^, this returns the same value since the XOR is taken against the u16 with an all-zero bitmask
|
||||||
|
"FeeRate::fee_vb", # Deprecated
|
||||||
|
"FeeRate::fee_wu", # Deprecated
|
||||||
|
|
||||||
# primitives
|
# primitives
|
||||||
"Sequence::from_512_second_intervals", # Mutant from replacing | with ^, this returns the same value since the XOR is taken against the u16 with an all-zero bitmask
|
"Sequence::from_512_second_intervals", # Mutant from replacing | with ^, this returns the same value since the XOR is taken against the u16 with an all-zero bitmask
|
||||||
|
|
|
@ -254,7 +254,7 @@ mod tests {
|
||||||
|
|
||||||
let weight = Weight::from_wu(381);
|
let weight = Weight::from_wu(381);
|
||||||
let fee_rate = FeeRate::from_sat_per_kwu(864);
|
let fee_rate = FeeRate::from_sat_per_kwu(864);
|
||||||
let fee = fee_rate.checked_mul_by_weight(weight).unwrap();
|
let fee = weight.checked_mul_by_fee_rate(fee_rate).unwrap();
|
||||||
// 381 * 0.864 yields 329.18.
|
// 381 * 0.864 yields 329.18.
|
||||||
// The result is then rounded up to 330.
|
// The result is then rounded up to 330.
|
||||||
assert_eq!(fee, Amount::from_sat_unchecked(330));
|
assert_eq!(fee, Amount::from_sat_unchecked(330));
|
||||||
|
|
Loading…
Reference in New Issue