cardano-ledger
cardano-ledger copied to clipboard
Added a hash field to MemoBytes
This PR adds a hash of the byte string to the MemoBytes data structure. This will make it easier to spot if the byte string representations of two MemoBytes values are different by calling show
on MemoBytes.
I also changed the type signature of MemoBytes t
to MemoBytes t era
and made all the necessary changes in other files. Some other type signatures also had to be changed as a consequence:
-
Mem t
->Mem t era
-
Timelock crypto
->Timelock era
-
MultiSig crypto
->MultiSig era
The MemoBytes
constructor and destructor are now behind a bidirectional pattern Memo
. Since we have to calculate the hash based on the current era and crypto, the pattern has a constraint Era era
, which had to be added to a lot of function signatures across the codebase.
closes #2882
@Soupstraw looks like you are hitting this bug as well. Can't quite pinpoint where exactly is the problem, but the tests indicate that it is in the Data
type.
@lehins It turned out to be a bug in my implementation of FromCBOR
for the data wrapper for Plutus.Data
😅