hydra-plutus-0.19.0: Hydra Plutus Contracts
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Contract.Commit

Description

The validator used to collect & open or abort a Head.

Synopsis

Documentation

data CommitRedeemer Source #

Constructors

ViaCollectCom 
ViaAbort 

Instances

Instances details
FromData CommitRedeemer Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

fromBuiltinData :: BuiltinData -> Maybe CommitRedeemer

ToData CommitRedeemer Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

toBuiltinData :: CommitRedeemer -> BuiltinData

UnsafeFromData CommitRedeemer Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

unsafeFromBuiltinData :: BuiltinData -> CommitRedeemer

data Commit Source #

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.

Constructors

Commit 

Fields

Instances

Instances details
Show Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Eq Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Ord Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Eq Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

(==) :: Commit -> Commit -> Bool

FromData Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

fromBuiltinData :: BuiltinData -> Maybe Commit

ToData Commit Source # 
Instance details

Defined in Hydra.Contract.Commit

Methods

toBuiltinData :: Commit -> BuiltinData

UnsafeFromData Commit Source # 
Instance details

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.

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 DatumType = (Party, [Commit], CurrencySymbol) 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 #

datum :: DatumType -> Datum Source #

redeemer :: RedeemerType -> Redeemer Source #