Add a test checking `PrivateKey::from_slice`

This test checks the previous fix - if ordered before the previous
commit it will fail.
This commit is contained in:
Martin Habovstiak 2025-03-04 20:34:59 +01:00
parent b87ddc0043
commit 1778fea66e
1 changed files with 7 additions and 0 deletions

View File

@ -1600,4 +1600,11 @@ mod tests {
panic!("Expected Invalid char error");
}
}
#[test]
fn invalid_private_key_len() {
use crate::Network;
assert!(PrivateKey::from_slice(&[1u8; 31], Network::Regtest).is_err());
assert!(PrivateKey::from_slice(&[1u8; 33], Network::Regtest).is_err());
}
}