| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Contract.Commit
Description
Representation of a UTxO when committed / deposited into the Hydra Head protocol. TODO: Rename/move this to Deposit
Synopsis
- data Commit = Commit {
- input :: TxOutRef
- preSerializedOutput :: BuiltinByteString
- serializeCommit :: (TxIn, TxOut CtxUTxO) -> Maybe Commit
- deserializeCommit :: Network -> Commit -> Maybe (TxIn, TxOut CtxUTxO)
Documentation
A data type representing committed outputs on-chain. Besides recording the
original TxOutRef, it also stores a binary representation compatible
between on- and off-chain code to be hashed in the validators.
Constructors
| Commit | |
Fields
| |
Instances
| Show Commit Source # | |
| Eq Commit Source # | |
| Ord Commit Source # | |
| Eq Commit Source # | |
Defined in Hydra.Contract.Commit | |
| FromData Commit Source # | |
Defined in Hydra.Contract.Commit Methods fromBuiltinData :: BuiltinData -> Maybe Commit | |
| ToData Commit Source # | |
Defined in Hydra.Contract.Commit Methods toBuiltinData :: Commit -> BuiltinData | |
| UnsafeFromData Commit Source # | |
Defined in Hydra.Contract.Commit Methods unsafeFromBuiltinData :: BuiltinData -> Commit | |
serializeCommit :: (TxIn, TxOut CtxUTxO) -> Maybe Commit Source #
Record an off-chain TxOut as a Commit on-chain.
NOTE: Depends on the Serialise instance for Plutus' Data.
NOTE: Reference scripts on the TxOut are NOT preserved. The Plutus TxOut
representation used for serialization has no reference script field, so any
inline reference script is silently dropped. Address, value and datum are
preserved faithfully.
deserializeCommit :: Network -> Commit -> Maybe (TxIn, TxOut CtxUTxO) Source #
Decode an on-chain SerializedTxOut back into an off-chain TxOut.
NOTE: Depends on the Serialise instance for Plutus' Data.