Remove usage of Cursor in pubkey sanity checks
We do not need to use `Cursor`, `io::Read` is implemented for slices of `u8`s.
This commit is contained in:
parent
35b5350088
commit
3ea44a166b
|
@ -1105,11 +1105,12 @@ mod tests {
|
||||||
assert!(PublicKey::read_from(&mut reader).is_err());
|
assert!(PublicKey::read_from(&mut reader).is_err());
|
||||||
|
|
||||||
// sanity checks
|
// sanity checks
|
||||||
assert!(PublicKey::read_from(&mut io::Cursor::new(&[])).is_err());
|
let mut empty: &[u8] = &[];
|
||||||
assert!(PublicKey::read_from(&mut io::Cursor::new(&[0; 33][..])).is_err());
|
assert!(PublicKey::read_from(&mut empty).is_err());
|
||||||
assert!(PublicKey::read_from(&mut io::Cursor::new(&[2; 32][..])).is_err());
|
assert!(PublicKey::read_from(&mut &[0; 33][..]).is_err());
|
||||||
assert!(PublicKey::read_from(&mut io::Cursor::new(&[0; 65][..])).is_err());
|
assert!(PublicKey::read_from(&mut &[2; 32][..]).is_err());
|
||||||
assert!(PublicKey::read_from(&mut io::Cursor::new(&[4; 64][..])).is_err());
|
assert!(PublicKey::read_from(&mut &[0; 65][..]).is_err());
|
||||||
|
assert!(PublicKey::read_from(&mut &[4; 64][..]).is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in New Issue