mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
Correct tests which should've failed to expect failures now that they fail
This commit is contained in:
parent
4ba961b2cb
commit
32c24917c4
1 changed files with 5 additions and 10 deletions
|
@ -105,15 +105,13 @@ fn padding_only_max_size() {
|
|||
#[test]
|
||||
fn padding_only_exceed_max_size() {
|
||||
let buf: Vec<u8> = vec![0; MAX_TX_EXTRA_PADDING_COUNT + 1];
|
||||
let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap();
|
||||
assert!(extra.0.is_empty());
|
||||
Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn invalid_padding_only() {
|
||||
let buf: Vec<u8> = vec![0, 42];
|
||||
let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap();
|
||||
assert!(extra.0.is_empty());
|
||||
Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -137,8 +135,7 @@ fn extra_nonce_only_wrong_size() {
|
|||
let mut buf: Vec<u8> = vec![0; 20];
|
||||
buf[0] = 2;
|
||||
buf[1] = 255;
|
||||
let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap();
|
||||
assert!(extra.0.is_empty());
|
||||
Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -158,8 +155,7 @@ fn pub_key_and_padding() {
|
|||
fn pub_key_and_invalid_padding() {
|
||||
let mut buf: Vec<u8> = PUB_KEY_BYTES.to_vec();
|
||||
buf.extend([0, 1]);
|
||||
let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap();
|
||||
assert_eq!(extra.0, vec![ExtraField::PublicKey(pub_key())]);
|
||||
Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -185,8 +181,7 @@ fn extra_mysterious_minergate_only_wrong_size() {
|
|||
let mut buf: Vec<u8> = vec![0; 20];
|
||||
buf[0] = 222;
|
||||
buf[1] = 255;
|
||||
let extra = Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap();
|
||||
assert!(extra.0.is_empty());
|
||||
Extra::read::<&[u8]>(&mut buf.as_ref()).unwrap_err();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue