Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Hydra.Tx.Commit
Contents
Synopsis
- commitTx :: NetworkId -> ScriptRegistry -> HeadId -> Party -> CommitBlueprintTx Tx -> (TxIn, TxOut CtxUTxO, Hash PaymentKey) -> Tx
- mkCommitDatum :: Party -> UTxO -> CurrencySymbol -> Datum
- data CommitObservation = CommitObservation {}
- observeCommitTx :: NetworkId -> UTxO -> Tx -> Maybe CommitObservation
Construction
Arguments
:: NetworkId | |
-> ScriptRegistry | Published Hydra scripts to reference. |
-> HeadId | |
-> Party | |
-> CommitBlueprintTx Tx | |
-> (TxIn, TxOut CtxUTxO, Hash PaymentKey) | The initial output (sent to each party) which should contain the PT and is locked by initial script |
-> Tx |
Craft a commit transaction which includes the "committed" utxo as a datum.
mkCommitDatum :: Party -> UTxO -> CurrencySymbol -> Datum Source #
Observation
data CommitObservation Source #
Full observation of a commit transaction.
Constructors
CommitObservation | |
Instances
Arguments
:: NetworkId | |
-> UTxO | A UTxO set to lookup tx inputs. Should at least contain the input spending from νInitial. |
-> Tx | |
-> Maybe CommitObservation |
Identify a commit tx by:
- Check that its spending from the init validator,
- Find the outputs which pays to the commit validator,
- Using the datum of that output, deserialize the committed output,
- Reconstruct the committed UTxO from both values (tx input and output).