Add mutant exclusions for consensus_encoding
What changed, and why it matters
This commit only updates a mutation-testing configuration file. It tells the mutation-testing tool to skip certain artificial code changes because they would cause test runs to loop forever. It does not change any actual library code, fix a bug, or alter behavior of the rust-bitcoin software in production.
No security action needed. This is a testing-infrastructure change only.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds regex exclusions to .cargo/mutants.toml for functions in the consensus_encoding module. These exclusions prevent cargo-mutants from generating mutants that would create infinite loops during mutation testing. No source code in the consensus_encoding module or elsewhere is modified.
Changed components
.cargo/mutants.tomlInspect captured patch +9 / −0
diff --git a/.cargo/mutants.toml b/.cargo/mutants.toml
index 6e2ac21e..a12e983c 100644
--- a/.cargo/mutants.toml
+++ b/.cargo/mutants.toml
@@ -49,4 +49,13 @@ exclude_re = [
"primitives/.* <impl Encoder for .*Encoder<'_>>::current_chunk", # Replacing the return with Some(vec![]) causes an infinite loop.
"primitives/.* <impl Encoder for .*Encoder<'_>>::advance", # Replacing the return with true causes an infinite loop.
"primitives/.* <impl Decoder for WitnessDecoder>::push_bytes", # Replacing == with != causes an infinite loop
+
+ # consensus_encoding - most of these are for mutations in the logic used to determine when to stop encoding or decoding.
+ "consensus_encoding/.* <impl Decoder for ArrayDecoder<N>>::push_bytes", # Mutations cause an infinite loop
+ "consensus_encoding/.* <impl Decoder for .*>::end", # Mutations cause an infinite loop
+ "consensus_encoding/.* encode_to_vec", # Mutations cause an infinite loop
+ "consensus_encoding/.* encode_to_writer", # Mutations cause an infinite loop
+ "consensus_encoding/.* decode_from_slice", # Mutations cause an infinite loop
+ "consensus_encoding/.* decode_from_read", # Mutations cause an infinite loop
+ "consensus_encoding/.* <impl Decoder for .*>::push_bytes", # Mutations cause an infinite loop
]
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.