Fix Psbt preimage keys in serde test

The preimage values in the serde Psbt don't actually correspond to the
hash keys they should in the serde test. This doesn't cause an error
currently because the derived serde implementation doesn't enforce their
validity during deserialization, but it will when the serde
implementation is modified to use the BIP-174 format.
This commit is contained in:
Daniel Roberts 2025-05-13 22:06:16 -05:00
parent 62026c1e2d
commit d7e9a84339
1 changed files with 4 additions and 4 deletions

View File

@ -1641,10 +1641,10 @@ mod tests {
)].into_iter().collect(),
bip32_derivation: keypaths.clone(),
final_script_witness: Some(Witness::from_slice(&[vec![1, 3], vec![5]])),
ripemd160_preimages: vec![(ripemd160::Hash::hash(&[]), vec![1, 2])].into_iter().collect(),
sha256_preimages: vec![(sha256::Hash::hash(&[]), vec![1, 2])].into_iter().collect(),
hash160_preimages: vec![(hash160::Hash::hash(&[]), vec![1, 2])].into_iter().collect(),
hash256_preimages: vec![(sha256d::Hash::hash(&[]), vec![1, 2])].into_iter().collect(),
ripemd160_preimages: vec![(ripemd160::Hash::hash(&[1, 2]), vec![1, 2])].into_iter().collect(),
sha256_preimages: vec![(sha256::Hash::hash(&[1, 2]), vec![1, 2])].into_iter().collect(),
hash160_preimages: vec![(hash160::Hash::hash(&[1, 2]), vec![1, 2])].into_iter().collect(),
hash256_preimages: vec![(sha256d::Hash::hash(&[1, 2]), vec![1, 2])].into_iter().collect(),
proprietary: proprietary.clone(),
unknown: unknown.clone(),
..Default::default()