Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype PlutusData era = PlutusData Data
- data Data era where
- unData ∷ Data era → Data
- type DataHash c = SafeHash c EraIndependentData
- upgradeData ∷ (Era era1, Era era2) ⇒ Data era1 → Data era2
- hashData ∷ Era era ⇒ Data era → DataHash (EraCrypto era)
- getPlutusData ∷ Data era → Data
- dataHashSize ∷ StrictMaybe (DataHash c) → Integer
- data BinaryData era
- hashBinaryData ∷ Era era ⇒ BinaryData era → DataHash (EraCrypto era)
- makeBinaryData ∷ Era era ⇒ ShortByteString → Either String (BinaryData era)
- binaryDataToData ∷ Era era ⇒ BinaryData era → Data era
- dataToBinaryData ∷ Era era ⇒ Data era → BinaryData era
- data Datum era
- datumDataHash ∷ Era era ⇒ Datum era → StrictMaybe (DataHash (EraCrypto era))
- translateDatum ∷ EraCrypto era1 ~ EraCrypto era2 ⇒ Datum era1 → Datum era2
Documentation
newtype PlutusData era Source #
This is a wrapper with a phantom era for PV1.Data, since we need something with kind (* -> *) for MemoBytes
Instances
Instances
type DataHash c = SafeHash c EraIndependentData Source #
upgradeData ∷ (Era era1, Era era2) ⇒ Data era1 → Data era2 Source #
Upgrade Data
from one era to another. While the underlying data will
remain the same, the memoised serialisation may change to reflect the
versioned serialisation of the new era.
getPlutusData ∷ Data era → Data Source #
dataHashSize ∷ StrictMaybe (DataHash c) → Integer Source #
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
hashBinaryData ∷ Era era ⇒ BinaryData era → DataHash (EraCrypto era) Source #
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
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 #
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) Source # | |
Generic (Datum era) Source # | |
Show (Datum era) Source # | |
Era era ⇒ DecCBOR (Datum era) Source # | |
Era era ⇒ EncCBOR (Datum era) Source # | |
Eq (Datum era) Source # | |
Ord (Datum era) Source # | |
Defined in Cardano.Ledger.Plutus.Data | |
NoThunks (Datum era) Source # | |
type Rep (Datum era) Source # | |
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 'DecidedStrict) (Rec0 (BinaryData era))))) |
datumDataHash ∷ Era era ⇒ Datum era → StrictMaybe (DataHash (EraCrypto era)) Source #
Get the Hash of the datum.