| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Tx.Close
Contents
Synopsis
- type PointInTime = (SlotNo, UTCTime)
- data OpenThreadOutput = OpenThreadOutput {
- openThreadUTxO :: (TxIn, TxOut CtxUTxO)
- openContestationPeriod :: ContestationPeriod
- openDepositPeriod :: DepositPeriod
- openParties :: [Party]
- isClosableAt :: SnapshotVersion -> Snapshot tx -> Bool
- closeTx :: ScriptRegistry -> VerificationKey PaymentKey -> HeadId -> SnapshotVersion -> ConfirmedSnapshot Tx -> SlotNo -> PointInTime -> OpenThreadOutput -> IncrementalAction -> Tx
- data CloseObservation = CloseObservation {}
- observeCloseTx :: UTxO -> Tx -> Maybe CloseObservation
Construction
type PointInTime = (SlotNo, UTCTime) Source #
data OpenThreadOutput Source #
Representation of the head thread UTxO while the head is in the Open state.
Constructors
| OpenThreadOutput | |
Fields
| |
Instances
isClosableAt :: SnapshotVersion -> Snapshot tx -> Bool Source #
Whether a head at the given open version can be closed with the snapshot, such that the closed head can later be fanned out.
The head validator only accepts a snapshot signed at the open version
(CloseInitial, CloseAny, CloseUnused) or one before
(CloseUsed). The latter stores the snapshot's applied accumulator,
which only matches the head value if the version bump was this snapshot's
own increment or decrement. For a snapshot without a pending action the
version moved on through another snapshot's settlement, so the closed head
could never be fanned out: a later snapshot this node has not adopted, or an
earlier commit this snapshot dropped once its increment could no longer
land, which landed after all. A settling decommit is never dropped (the
snapshot request handler requires every request at its version to carry
it), so a confirmed snapshot never lags the head by a decommit it already
accounts for.
Arguments
| :: ScriptRegistry | Published Hydra scripts to reference. |
| -> VerificationKey PaymentKey | Party who's authorizing this transaction |
| -> HeadId | Head identifier |
| -> SnapshotVersion | Last known version of the open head. |
| -> ConfirmedSnapshot Tx | Snapshot with instructions how to close the head. |
| -> SlotNo | Lower validity slot number, usually a current or quite recent slot number. |
| -> PointInTime | Upper validity slot and UTC time to compute the contestation deadline time. |
| -> OpenThreadOutput | Everything needed to spend the Head state-machine output. |
| -> IncrementalAction | |
| -> Tx |
Create a transaction closing a head with either the initial snapshot or with a multi-signed confirmed snapshot.
Observation
data CloseObservation Source #
Constructors
| CloseObservation | |
Fields
| |
Instances
Arguments
| :: UTxO | A UTxO set to lookup tx inputs |
| -> Tx | |
| -> Maybe CloseObservation |
Identify a close tx by lookup up the input spending the Head output and decoding its redeemer.