Use boxed sliced instead of Vec in InvalidPreimageHashPair variant
This commit is contained in:
parent
781b0e014a
commit
0eaf45ca81
|
@ -68,9 +68,9 @@ pub enum Error {
|
|||
/// Hash-type
|
||||
hash_type: PsbtHash,
|
||||
/// Pre-image
|
||||
preimage: Vec<u8>,
|
||||
preimage: Box<[u8]>,
|
||||
/// Hash value
|
||||
hash: Vec<u8>,
|
||||
hash: Box<[u8]>,
|
||||
},
|
||||
/// Data inconsistency/conflicting data during merge procedure
|
||||
MergeConflict(String),
|
||||
|
|
|
@ -311,8 +311,8 @@ where
|
|||
let val: Vec<u8> = Deserialize::deserialize(&raw_value)?;
|
||||
if <H as hashes::Hash>::hash(&val) != key_val {
|
||||
return Err(psbt::Error::InvalidPreimageHashPair {
|
||||
preimage: val,
|
||||
hash: Vec::from(key_val.borrow()),
|
||||
preimage: val.into_boxed_slice(),
|
||||
hash: Box::from(key_val.borrow()),
|
||||
hash_type: hash_type,
|
||||
}
|
||||
.into());
|
||||
|
|
Loading…
Reference in New Issue