diff --git a/src/util/psbt/serialize.rs b/src/util/psbt/serialize.rs index 8492e8af..bb1443a5 100644 --- a/src/util/psbt/serialize.rs +++ b/src/util/psbt/serialize.rs @@ -367,3 +367,15 @@ impl Deserialize for TapTree { fn key_source_len(key_source: &KeySource) -> usize { 4 + 4 * (key_source.1).as_ref().len() } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn can_deserialize_non_standard_psbt_sig_hash_type() { + let non_standard_sighash = [222u8, 0u8, 0u8, 0u8]; // 32 byte value. + let sighash = PsbtSigHashType::deserialize(&non_standard_sighash); + assert!(sighash.is_ok()) + } +}