Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Data era where
- getPlutusData ∷ Data era → Data
- type DataHash c = SafeHash c EraIndependentData
- hashData ∷ Era era ⇒ Data era → DataHash (EraCrypto era)
- data Datum era
- datumDataHash ∷ Era era ⇒ Datum era → StrictMaybe (DataHash (EraCrypto era))
- data BinaryData era
- makeBinaryData ∷ Era era ⇒ ShortByteString → Either String (BinaryData era)
- hashBinaryData ∷ Era era ⇒ BinaryData era → DataHash (EraCrypto era)
- binaryDataToData ∷ Era era ⇒ BinaryData era → Data era
- dataToBinaryData ∷ Era era ⇒ Data era → BinaryData era
Plutus Data
Instances
getPlutusData ∷ Data era → Data Source #
type DataHash c = SafeHash c EraIndependentData Source #
Inline Datum
Datum can be described by a either a data hash or binary data, but not both. It can also be neither one of them.
Instances
Era era ⇒ ToJSON (Datum era) | |
Generic (Datum era) | |
Show (Datum era) | |
Era era ⇒ DecCBOR (Datum era) | |
Era era ⇒ EncCBOR (Datum era) | |
Eq (Datum era) | |
Ord (Datum era) | |
Defined in Cardano.Ledger.Plutus.Data | |
NoThunks (Datum era) | |
type Rep (Datum era) | |
Defined in Cardano.Ledger.Plutus.Data type Rep (Datum era) = D1 ('MetaData "Datum" "Cardano.Ledger.Plutus.Data" "cardano-ledger-core-1.16.0.0-inplace" 'False) (C1 ('MetaCons "NoDatum" 'PrefixI 'False) (U1 ∷ Type → Type) :+: (C1 ('MetaCons "DatumHash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (DataHash (EraCrypto era)))) :+: C1 ('MetaCons "Datum" 'PrefixI 'False) (S1 ('MetaSel ('Nothing ∷ Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 (BinaryData era))))) |
datumDataHash ∷ Era era ⇒ Datum era → StrictMaybe (DataHash (EraCrypto era)) Source #
Get the Hash of the datum.
BinaryData
data BinaryData era Source #
Inlined data must be stored in the most compact form because it contributes
to the memory overhead of the ledger state. Constructor is intentionally not
exported, in order to prevent invalid creation of data from arbitrary binary
data. Use makeBinaryData
for smart construction.
Instances
makeBinaryData ∷ Era era ⇒ ShortByteString → Either String (BinaryData era) Source #
Construct BinaryData
from a buffer of bytes, while ensuring that it can be later
safely converted to Data
with binaryDataToData
hashBinaryData ∷ Era era ⇒ BinaryData era → DataHash (EraCrypto era) Source #
binaryDataToData ∷ Era era ⇒ BinaryData era → Data era Source #
It is safe to convert BinaryData
to Data
because the only way to
construct BinaryData
is through the smart constructor makeBinaryData
that
takes care of validation.
dataToBinaryData ∷ Era era ⇒ Data era → BinaryData era Source #