Use BlockHash to test serialization behaviour
What changed, and why it matters
This is a tiny test-only change that swaps one placeholder type for another in a single unit test. It does not alter any production code, behavior, or security boundary.
No action required. This is a non-functional test refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes one line in bitcoin/src/consensus/encode.rs from deserializing a Vec
Changed components
bitcoin/src/consensus/encode.rs (test code only)Inspect captured patch +1 / −1
diff --git a/bitcoin/src/consensus/encode.rs b/bitcoin/src/consensus/encode.rs
index b9c24166..c3bf6ba7 100644
--- a/bitcoin/src/consensus/encode.rs
+++ b/bitcoin/src/consensus/encode.rs
@@ -1023,7 +1023,7 @@ mod tests {
// Check serialization that `if len > MAX_VEC_SIZE {return err}` isn't inclusive,
// by making sure it fails with `MissingData` and not an `OversizedVectorAllocation` Error.
let err =
- deserialize::<CheckedData>(&serialize(&(super::MAX_VEC_SIZE as u32))).unwrap_err();
+ deserialize::<BlockHash>(&serialize(&(super::MAX_VEC_SIZE as u32))).unwrap_err();
assert_eq!(err, DeserializeError::Parse(ParseError::MissingData));
test_len_is_max_vec::<u8>();
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.