Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
The initial validator which allows participants to commit or abort.
Synopsis
- data InitialRedeemer
- = ViaAbort
- | ViaCommit {
- committedRefs :: [TxOutRef]
- type DatumType = CurrencySymbol
- type RedeemerType = InitialRedeemer
- validator :: ScriptHash -> DatumType -> RedeemerType -> ScriptContext -> Bool
- checkCommit :: ScriptHash -> CurrencySymbol -> [TxOutRef] -> ScriptContext -> Bool
- compiledValidator :: CompiledCode ValidatorType
- validatorScript :: SerialisedScript
- validatorHash :: ScriptHash
- datum :: DatumType -> Datum
- redeemer :: RedeemerType -> Redeemer
Documentation
data InitialRedeemer Source #
ViaAbort | |
ViaCommit | |
|
Instances
FromData InitialRedeemer Source # | |
Defined in Hydra.Contract.Initial fromBuiltinData :: BuiltinData -> Maybe InitialRedeemer | |
ToData InitialRedeemer Source # | |
Defined in Hydra.Contract.Initial toBuiltinData :: InitialRedeemer -> BuiltinData | |
UnsafeFromData InitialRedeemer Source # | |
Defined in Hydra.Contract.Initial unsafeFromBuiltinData :: BuiltinData -> InitialRedeemer |
type RedeemerType = InitialRedeemer Source #
:: ScriptHash | Hash of the commit validator |
-> DatumType | |
-> RedeemerType | |
-> ScriptContext | |
-> Bool |
The v_initial validator verifies that:
- spent in a transaction also consuming a v_head output
- ensures the committed value is recorded correctly in the output datum
- ensures that the transaction was signed by the key corresponding to the PubKeyHash encoded in the participation token name
NOTE: It does not need to ensure that the participation token is of some specific Head currency.
:: ScriptHash | Hash of the commit validator |
-> CurrencySymbol | Head id |
-> [TxOutRef] | |
-> ScriptContext | |
-> Bool |
compiledValidator :: CompiledCode ValidatorType Source #
validatorScript :: SerialisedScript Source #
validatorHash :: ScriptHash Source #
redeemer :: RedeemerType -> Redeemer Source #