Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
The validator used to collect & open or abort a Head.
Synopsis
- data CommitRedeemer
- data Commit = Commit {
- input :: TxOutRef
- preSerializedOutput :: BuiltinByteString
- serializeCommit :: (TxIn, TxOut CtxUTxO) -> Maybe Commit
- deserializeCommit :: Network -> Commit -> Maybe (TxIn, TxOut CtxUTxO)
- type DatumType = (Party, [Commit], CurrencySymbol)
- type RedeemerType = CommitRedeemer
- validator :: DatumType -> RedeemerType -> ScriptContext -> Bool
- compiledValidator :: CompiledCode ValidatorType
- validatorScript :: SerialisedScript
- validatorHash :: ScriptHash
- datum :: DatumType -> Datum
- redeemer :: RedeemerType -> Redeemer
Documentation
data CommitRedeemer Source #
Instances
FromData CommitRedeemer Source # | |
Defined in Hydra.Contract.Commit fromBuiltinData :: BuiltinData -> Maybe CommitRedeemer | |
ToData CommitRedeemer Source # | |
Defined in Hydra.Contract.Commit toBuiltinData :: CommitRedeemer -> BuiltinData | |
UnsafeFromData CommitRedeemer Source # | |
Defined in Hydra.Contract.Commit unsafeFromBuiltinData :: BuiltinData -> CommitRedeemer |
A data type representing comitted 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.
Commit | |
|
Instances
Show Commit Source # | |
Eq Commit Source # | |
Ord Commit Source # | |
Defined in Hydra.Contract.Commit | |
Eq Commit Source # | |
Defined in Hydra.Contract.Commit | |
FromData Commit Source # | |
Defined in Hydra.Contract.Commit fromBuiltinData :: BuiltinData -> Maybe Commit | |
ToData Commit Source # | |
Defined in Hydra.Contract.Commit toBuiltinData :: Commit -> BuiltinData | |
UnsafeFromData Commit Source # | |
Defined in Hydra.Contract.Commit 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
.
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
.
type RedeemerType = CommitRedeemer Source #
validator :: DatumType -> RedeemerType -> ScriptContext -> Bool Source #
The v_commit validator verifies that:
- spent in a transaction also consuming a v_head output
- ST is burned if the redeemer is
ViaAbort
- ST is present in the output if the redeemer is
ViaCollectCom
compiledValidator :: CompiledCode ValidatorType Source #
validatorScript :: SerialisedScript Source #
validatorHash :: ScriptHash Source #
redeemer :: RedeemerType -> Redeemer Source #