| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Tx.Init
Contents
Synopsis
- initTx :: NetworkId -> PParams LedgerEra -> TxIn -> [OnChainId] -> HeadParameters -> Tx
- mkHeadOutput :: NetworkId -> PolicyId -> [OnChainId] -> TxOutDatum ctx -> TxOut ctx
- data InitObservation = InitObservation {}
- data NotAnInitReason
- isMalformedInit :: NotAnInitReason -> Bool
- observeInitTx :: Tx -> Either NotAnInitReason InitObservation
Construction
Arguments
| :: NetworkId | |
| -> PParams LedgerEra | Current protocol parameters, used to compute worst-case min-UTxO. |
| -> TxIn | Seed input. |
| -> [OnChainId] | Verification key hashes of all participants. |
| -> HeadParameters | |
| -> Tx |
Create the init transaction from some HeadParameters and a single TxIn
which will be used as unique parameter for minting NFTs.
mkHeadOutput :: NetworkId -> PolicyId -> [OnChainId] -> TxOutDatum ctx -> TxOut ctx Source #
Observation
data InitObservation Source #
Data which can be observed from an initTx.
Constructors
| InitObservation | |
Fields
| |
Instances
data NotAnInitReason Source #
Constructors
| NoHeadOutput | |
| NotAHeadDatum | |
| InvalidPartyInDatum | |
| InvalidContestationPeriodInDatum Text | |
| InvalidDepositPeriodInDatum Text | |
| NoSTFound | |
| NotAHeadPolicy | |
| NoTokensMinted |
Instances
isMalformedInit :: NotAnInitReason -> Bool Source #
Whether the reason describes a transaction that really did mint this head's tokens but carries a datum the node cannot use, as opposed to a transaction that is simply not an init. Only the former is worth reporting: the latter fires for every unrelated transaction on the chain, and for every increment/decrement.
observeInitTx :: Tx -> Either NotAnInitReason InitObservation Source #
Identify a init tx by checking the output value for holding tokens that are valid head tokens (checked by seed + policy).