import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks)
-
import qualified PlutusLedgerApi.V1 as PV1 -- NOTE PV1.Data === PV2.Data
+
-- NOTE PV1.Data === PV2.Data
+
import Cardano.Ledger.TreeDiff (ToExpr)
+
import qualified PlutusLedgerApi.V1 as PV1
-- ============================================================================
-- the newtype Data is a wrapper around the type that Plutus expects as data.
-- exported, in order to prevent invalid creation of data from arbitrary binary
-- data. Use `makeBinaryData` for smart construction.
newtype BinaryData era = BinaryData ShortByteString
-
deriving newtype (Eq, NoThunks, Ord, Show, SafeToHash)
+
deriving newtype (Eq, NoThunks, Ord, Show, SafeToHash, ToExpr)
instance EraCrypto era ~ c => HashAnnotated (BinaryData era) EraIndependentData c
| DatumHash !(DataHash (EraCrypto era))
| Datum !(BinaryData era)
-
deriving (Eq, Generic, NoThunks, Ord, Show)
+
deriving (Eq, Generic, NoThunks, Ord, Show, ToExpr)
instance Era era => EncCBOR (Datum era) where
encCBOR d = encode $ case d of