hydra-tx-0.20.0: Hydra transaction library
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Tx.Commit

Synopsis

Construction

commitTx Source #

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 

Fields

Instances

Instances details
Generic CommitObservation Source # 
Instance details

Defined in Hydra.Tx.Commit

Associated Types

type Rep CommitObservation :: Type -> Type Source #

Show CommitObservation Source # 
Instance details

Defined in Hydra.Tx.Commit

Eq CommitObservation Source # 
Instance details

Defined in Hydra.Tx.Commit

type Rep CommitObservation Source # 
Instance details

Defined in Hydra.Tx.Commit

type Rep CommitObservation = D1 ('MetaData "CommitObservation" "Hydra.Tx.Commit" "hydra-tx-0.20.0-b01Sd51Fpn1r0Mfj7XdB1" 'False) (C1 ('MetaCons "CommitObservation" 'PrefixI 'True) ((S1 ('MetaSel ('Just "commitOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxIn, TxOut CtxUTxO)) :*: S1 ('MetaSel ('Just "party") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Party)) :*: (S1 ('MetaSel ('Just "committed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO) :*: S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId))))

observeCommitTx Source #

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).