cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Datum

Description

This module exposes the notion of datums as they are handled within a TxSkel

Synopsis

Documentation

type DatumConstrs datum = (Show datum, PrettyCooked datum, ToData datum, FromData datum, Eq datum, Typeable datum) Source #

Type constraints that must be satisfied by the datum content

data DatumResolved Source #

Whether the datum should be resolved in the transaction

Constructors

NotResolved

Do not resolve the datum (absent from txInfoData)

Resolved

Resolve the datum (present from txInfoData)

data DatumKind Source #

Options on how to include the datum in the transaction

Constructors

Inline

Include the full datum in the UTxO

Hashed DatumResolved

Only include the datum hash in the UTxO. Resolve, or do not resolve, the full datum in the transaction body.

Instances

Instances details
Show DatumKind Source # 
Instance details

Defined in Cooked.Skeleton.Datum

Eq DatumKind Source # 
Instance details

Defined in Cooked.Skeleton.Datum

Ord DatumKind Source # 
Instance details

Defined in Cooked.Skeleton.Datum

data TxSkelOutDatum where Source #

Datums to be placed in TxSkel outputs, which are either empty, or composed of a datum content and its placement

Constructors

NoTxSkelOutDatum :: TxSkelOutDatum

use no datum

SomeTxSkelOutDatum :: DatumConstrs dat => dat -> DatumKind -> TxSkelOutDatum

use some datum content and associated placement

datumKindResolvedP :: Prism' DatumKind DatumResolved Source #

Builds a DatumKind from a DatumResolved or optionally retrieves it

txSkelOutDatumTypedAT :: (DatumConstrs a, DatumConstrs b) => AffineTraversal TxSkelOutDatum TxSkelOutDatum a b Source #

Extracts, or sets, the typed datum of a TxSkelOutDatum. This is attempted in two ways: first, we try to simply cast the content, and then, if it fails, we serialise the content and then attempt to deserialise it to the right type. This second case is specifically useful when the current content is an BuiltinData itself directly, but it can also be used in the cornercase when both types have compatible serialized representation.