fix: Stop double CBOR encoding of Plutus script used for hashing (#188)
This commit is contained in:
parent
bda79061ce
commit
e3d9d8f9a3
3 changed files with 34 additions and 5 deletions
|
|
@ -69,6 +69,14 @@ macro_rules! common_hasher {
|
|||
hasher.finalize()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hash_tagged(bytes: &[u8], tag: u8) -> Hash<{ $size / 8 }> {
|
||||
let mut hasher = Self::new();
|
||||
hasher.input(&[tag]);
|
||||
hasher.input(bytes);
|
||||
hasher.finalize()
|
||||
}
|
||||
|
||||
/// convenient function to directly generate the hash
|
||||
/// of the given [minicbor::Encode] data object
|
||||
#[inline]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue