Add test checking `XOnlyPublicKey::deserialize`

This test checks the previous fix - if ordered before the previous
commit it will fail.
This commit is contained in:
Martin Habovstiak 2025-03-05 13:09:44 +01:00
parent bbe87eccf2
commit ecc5791930
1 changed files with 6 additions and 0 deletions

View File

@ -461,6 +461,12 @@ mod tests {
assert!(sighash.is_ok()) assert!(sighash.is_ok())
} }
#[test]
fn deserialize_xonly_public_key_len() {
assert!(XOnlyPublicKey::deserialize(&[1; 31]).is_err());
assert!(XOnlyPublicKey::deserialize(&[1; 33]).is_err());
}
#[test] #[test]
#[should_panic(expected = "InvalidMagic")] #[should_panic(expected = "InvalidMagic")]
fn invalid_vector_1() { fn invalid_vector_1() {