Skip to content

Commit

Permalink
Fixed infinite loop in Data deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Soupstraw committed Aug 9, 2022
1 parent 216047c commit 7678d85
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Data.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ deriving instance NoThunks Plutus.Data
-- | This is a wrapper with a phantom era for Plutus.Data, since we need
-- something with kind (* -> *) for MemoBytes
newtype PlutusData era = PlutusData Plutus.Data
deriving newtype (Eq, Generic, Show, ToCBOR, NFData, NoThunks)
deriving newtype (Eq, Generic, Show, ToCBOR, NFData, NoThunks, Cborg.Serialise)

deriving via
(Annotator (PlutusData era))
instance
Typeable era => FromCBOR (Annotator (PlutusData era))
instance Typeable era => FromCBOR (Annotator (PlutusData era)) where
fromCBOR = pure <$> Cborg.decode

newtype Data era = DataConstr (MemoBytes PlutusData era)
deriving (Eq, Generic, Show)
Expand Down

0 comments on commit 7678d85

Please sign in to comment.