Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cooked.Skeleton.Datum
Synopsis
- type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, ToData a, Eq a, Typeable a)
- data TxSkelOutDatum where
- TxSkelOutNoDatum :: TxSkelOutDatum
- TxSkelOutDatumHash :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum
- TxSkelOutDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum
- TxSkelOutInlineDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum
- txSkelOutTypedDatum :: Typeable a => TxSkelOutDatum -> Maybe a
- txSkelOutUntypedDatum :: TxSkelOutDatum -> Maybe Datum
Documentation
type TxSkelOutDatumConstrs a = (Show a, PrettyCooked a, ToData a, Eq a, Typeable a) Source #
data TxSkelOutDatum where Source #
On transaction outputs, we have the options to use
- no datum
- only a datum hash
- a "normal" datum
- an inline datum
These four options are also what the type TxSkelOutDatum
records. The
following table explains their differences.
datum stored in in the simulated chain state |
datum resolved
on the txInfoData | OutputDatum
constructor
seen by the validator | |
---|---|---|---|
TxSkelOutNoDatum | no | no | NoOutputDatum |
TxSkelOutDatumHash | yes | no | OutputDatumHash |
TxSkelOutDatum | yes | yes | OutputDatumHash |
TxSkelOutInlineDatum | yes | no | OutputDatum |
That is:
- Whenever there is a datum, we'll store it in the state of our simulated
chain. This will make it possible to retrieve it later, using functions
such as
datumFromHash
. - Both of the
TxSkelOutDatumHash
andTxSkelOutDatum
constructors will create an output that scripts see on thetxInfo
as having a datum hash. The difference is whether that hash will be resolvable using validator functions likefindDatum
.
Constructors
TxSkelOutNoDatum :: TxSkelOutDatum | use no datum |
TxSkelOutDatumHash :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum | only include the hash on the transaction |
TxSkelOutDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum | use a |
TxSkelOutInlineDatum :: TxSkelOutDatumConstrs a => a -> TxSkelOutDatum | use an inline datum |
Instances
txSkelOutTypedDatum :: Typeable a => TxSkelOutDatum -> Maybe a Source #