| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Transaction.Datum
Description
Output datum alternatives. Inline data retains exact datum bytes because re-encoding a datum can change its hash.
noDatum = NoDatum
Synopsis
- data Datum
- data Hash32
- hashFromBytes :: ByteString -> Either Error Hash32
- hashBytes :: Hash32 -> ByteString
Documentation
Output datum choice. A hash carries no witness datum; inline data carries the exact encoded datum, including arbitrary map order and duplicate keys.
Constructors
| NoDatum | No datum is attached to the output. |
| DatumHash !Hash32 | Hash identifying a datum supplied separately as a witness when needed. |
| InlineDatum !EncodedPlutusData | Exact datum bytes embedded directly in the output. |
An exact 32-byte datum, script-data or auxiliary-data digest. Equality and ordering compare bytes; importing does not verify how the digest was obtained.
hashFromBytes :: ByteString -> Either Error Hash32 Source #
Validate exactly 32 digest bytes; otherwise return InvalidTransactionHashLength.
hashBytes :: Hash32 -> ByteString Source #
Exact digest bytes, always length 32.