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
|
||||||
hash_type: PsbtHash,
|
hash_type: PsbtHash,
|
||||||
/// Pre-image
|
/// Pre-image
|
||||||
preimage: Vec<u8>,
|
preimage: Box<[u8]>,
|
||||||
/// Hash value
|
/// Hash value
|
||||||
hash: Vec<u8>,
|
hash: Box<[u8]>,
|
||||||
},
|
},
|
||||||
/// Data inconsistency/conflicting data during merge procedure
|
/// Data inconsistency/conflicting data during merge procedure
|
||||||
MergeConflict(String),
|
MergeConflict(String),
|
||||||
|
|
|
@ -311,8 +311,8 @@ where
|
||||||
let val: Vec<u8> = Deserialize::deserialize(&raw_value)?;
|
let val: Vec<u8> = Deserialize::deserialize(&raw_value)?;
|
||||||
if <H as hashes::Hash>::hash(&val) != key_val {
|
if <H as hashes::Hash>::hash(&val) != key_val {
|
||||||
return Err(psbt::Error::InvalidPreimageHashPair {
|
return Err(psbt::Error::InvalidPreimageHashPair {
|
||||||
preimage: val,
|
preimage: val.into_boxed_slice(),
|
||||||
hash: Vec::from(key_val.borrow()),
|
hash: Box::from(key_val.borrow()),
|
||||||
hash_type: hash_type,
|
hash_type: hash_type,
|
||||||
}
|
}
|
||||||
.into());
|
.into());
|
||||||
|
|
Loading…
Reference in New Issue