test: add invalid segwit transaction test
This commit is contained in:
parent
5e3d1295e0
commit
fe8d559d69
|
@ -1638,6 +1638,17 @@ mod tests {
|
||||||
assert_eq!(realtx.base_size(), tx_bytes.len());
|
assert_eq!(realtx.base_size(), tx_bytes.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn segwit_invalid_transaction() {
|
||||||
|
let tx_bytes = hex!("0000fd000001021921212121212121212121f8b372b0239cc1dff600000000004f4f4f4f4f4f4f4f000000000000000000000000000000333732343133380d000000000000000000000000000000ff000000000009000dff000000000000000800000000000000000d");
|
||||||
|
let tx: Result<Transaction, _> = deserialize(&tx_bytes);
|
||||||
|
assert!(tx.is_err());
|
||||||
|
assert!(tx
|
||||||
|
.unwrap_err()
|
||||||
|
.to_string()
|
||||||
|
.contains("witness flag set but no witnesses present"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn segwit_transaction() {
|
fn segwit_transaction() {
|
||||||
let tx_bytes = hex!(
|
let tx_bytes = hex!(
|
||||||
|
|
Loading…
Reference in New Issue