hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.HeadLogic.Outcome

Synopsis

Documentation

data Effect tx Source #

Analogous to inputs, the pure head logic "core" can have effects emitted to the "shell" layers and we distinguish the same: effects onto the client, the network and the chain.

Constructors

ClientEffect

Effect to be handled by the Hydra.API, results in sending this ClientMessage.

NetworkEffect

Effect to be handled by a Hydra.Network, results in a broadcast.

Fields

OnChainEffect

Effect to be handled by a Hydra.Chain, results in a postTx.

Fields

Instances

Instances details
IsChainState tx => ToJSON (Effect tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

toJSON :: Effect tx -> Value

toEncoding :: Effect tx -> Encoding

toJSONList :: [Effect tx] -> Value

toEncodingList :: [Effect tx] -> Encoding

omitField :: Effect tx -> Bool

Generic (Effect tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Associated Types

type Rep (Effect tx) :: Type -> Type Source #

Methods

from :: Effect tx -> Rep (Effect tx) x Source #

to :: Rep (Effect tx) x -> Effect tx Source #

IsChainState tx => Show (Effect tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

IsChainState tx => Eq (Effect tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

(==) :: Effect tx -> Effect tx -> Bool Source #

(/=) :: Effect tx -> Effect tx -> Bool Source #

type Rep (Effect tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

type Rep (Effect tx) = D1 ('MetaData "Effect" "Hydra.HeadLogic.Outcome" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "ClientEffect" 'PrefixI 'True) (S1 ('MetaSel ('Just "clientMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ClientMessage tx))) :+: (C1 ('MetaCons "NetworkEffect" 'PrefixI 'True) (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Message tx))) :+: C1 ('MetaCons "OnChainEffect" 'PrefixI 'True) (S1 ('MetaSel ('Just "postChainTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (PostChainTx tx)))))

data StateChanged tx Source #

Head state changed event. These events represent all the internal state changes, get persisted and processed in an event sourcing manner.

Constructors

NetworkConnected 
NetworkDisconnected 
PeerConnected 

Fields

PeerDisconnected 

Fields

NetworkVersionMismatch 
NetworkClusterIDMismatch 

Fields

HeadOpened 

Fields

TransactionReceived 

Fields

  • tx :: tx
     
TransactionAppliedToLocalUTxO 

Fields

SnapshotRequestDecided 

Fields

SnapshotRequested 

Fields

PartySignedSnapshot 

Fields

SnapshotConfirmed 

Fields

DepositRecorded 

Fields

DepositActivated 

Fields

DepositExpired 

Fields

DepositRecovered 

Fields

CommitApproved 

Fields

CommitFinalized 

Fields

DecommitRecorded 

Fields

DecommitApproved 

Fields

DecommitInvalid 
DecommitFinalized 

Fields

HeadClosed 

Fields

HeadContested 

Fields

HeadIsReadyToFanout 

Fields

HeadFanoutInitiated

This node initiated a full automatic fanout (Fanout command). It transitions ClosedPartialFanout in AutoDrain mode so that this node (the driver) auto-continues draining as chunks are observed. Other parties that merely observe the resulting partial fanout do NOT auto-drive (they go to AwaitingSelection). No chain state change (client command).

Fields

HeadPartialFanoutSelected

A user initiated or updated a selective partial fanout. From Closed this transitions into the PartialFanout state (using $sel:remainingOutputs:NetworkConnected as the initial remaining set); from PartialFanout it just updates the active selection. No chain state change (driven by a client command).

Fields

HeadFanoutReverted

Revert an optimistic ClosedPartialFanout transition back to Closed. Emitted when posting the initiating fanout transaction fails terminally before any partial fanout has landed on chain (i.e. while the off-chain state is PartialFanout but the on-chain datum is still Closed). Without this the head would wedge in PartialFanout with Fanout rejected. No chain state change.

Fields

HeadFannedOut 

Fields

HeadPartialFannedOut 

Fields

ChainRolledBack 

Fields

TickObserved 

Fields

IgnoredHeadInitializing 

Fields

TxInvalid 

Fields

LocalStateCleared 

Fields

Checkpoint 

Fields

NodeUnsynced 

Fields

NodeSynced 

Fields

Instances

Instances details
(IsChainState tx, IsTx tx, FromJSON (NodeState tx), FromJSON (ChainStateType tx)) => FromJSON (StateChanged tx) Source #

Decoded generically, except that a HeadPartialFannedOut persisted before the $sel:mode:NetworkConnected field existed (event logs from an earlier node) is decoded with $sel:mode:NetworkConnected defaulting to AwaitingSelection. That is the safe default: the node waits for the next PartialFanout rather than assuming an auto-drain, so a node mid-fanout can still restart. All other constructors decode as before.

Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

parseJSON :: Value -> Parser (StateChanged tx)

parseJSONList :: Value -> Parser [StateChanged tx]

omittedField :: Maybe (StateChanged tx)

(IsChainState tx, IsTx tx, ToJSON (ChainStateType tx)) => ToJSON (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

toJSON :: StateChanged tx -> Value

toEncoding :: StateChanged tx -> Encoding

toJSONList :: [StateChanged tx] -> Value

toEncodingList :: [StateChanged tx] -> Encoding

omitField :: StateChanged tx -> Bool

Generic (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Associated Types

type Rep (StateChanged tx) :: Type -> Type Source #

(IsChainState tx, IsTx tx, Show (NodeState tx), Show (ChainStateType tx)) => Show (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

IsChainState tx => FromCBOR (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

fromCBOR :: Decoder s (StateChanged tx)

label :: Proxy (StateChanged tx) -> Text

IsChainState tx => ToCBOR (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

toCBOR :: StateChanged tx -> Encoding

encodedSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy (StateChanged tx) -> Size

encodedListSizeExpr :: (forall t. ToCBOR t => Proxy t -> Size) -> Proxy [StateChanged tx] -> Size

(IsChainState tx, IsTx tx, Eq (NodeState tx), Eq (ChainStateType tx)) => Eq (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

type Rep (StateChanged tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

type Rep (StateChanged tx) = D1 ('MetaData "StateChanged" "Hydra.HeadLogic.Outcome" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (((((C1 ('MetaCons "NetworkConnected" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NetworkDisconnected" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "PeerConnected" 'PrefixI 'True) (S1 ('MetaSel ('Just "peer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Host)) :+: C1 ('MetaCons "PeerDisconnected" 'PrefixI 'True) (S1 ('MetaSel ('Just "peer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Host)))) :+: ((C1 ('MetaCons "NetworkVersionMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "ourVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProtocolVersion) :*: S1 ('MetaSel ('Just "theirVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ProtocolVersion))) :+: C1 ('MetaCons "NetworkClusterIDMismatch" 'PrefixI 'True) (S1 ('MetaSel ('Just "clusterPeers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "misconfiguredPeers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))) :+: (C1 ('MetaCons "HeadOpened" 'PrefixI 'True) ((S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadParameters) :*: S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx))) :*: (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "headSeed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadSeed) :*: S1 ('MetaSel ('Just "parties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Party])))) :+: (C1 ('MetaCons "TransactionReceived" 'PrefixI 'True) (S1 ('MetaSel ('Just "tx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx)) :+: C1 ('MetaCons "TransactionAppliedToLocalUTxO" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "tx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx)))))) :+: (((C1 ('MetaCons "SnapshotRequestDecided" 'PrefixI 'True) (S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber)) :+: C1 ('MetaCons "SnapshotRequested" 'PrefixI 'True) (S1 ('MetaSel ('Just "requestedSnapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Snapshot tx)) :*: (S1 ('MetaSel ('Just "newLocalTxs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq tx)) :*: S1 ('MetaSel ('Just "newCurrentDepositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (TxIdType tx)))))) :+: (C1 ('MetaCons "PartySignedSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber) :*: (S1 ('MetaSel ('Just "party") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Party) :*: S1 ('MetaSel ('Just "signature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Signature (Snapshot tx))))) :+: (C1 ('MetaCons "SnapshotConfirmed" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "snapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (Snapshot tx))) :*: S1 ('MetaSel ('Just "signatures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MultiSignature (Snapshot tx))))) :+: C1 ('MetaCons "DepositRecorded" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)))) :*: (S1 ('MetaSel ('Just "deposited") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: (S1 ('MetaSel ('Just "created") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "deadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime))))))) :+: ((C1 ('MetaCons "DepositActivated" 'PrefixI 'True) (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "deposit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Deposit tx)))) :+: C1 ('MetaCons "DepositExpired" 'PrefixI 'True) (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "deposit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Deposit tx))))) :+: (C1 ('MetaCons "DepositRecovered" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId)) :*: (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: S1 ('MetaSel ('Just "recovered") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: (C1 ('MetaCons "CommitApproved" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "utxoToCommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "CommitFinalized" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId)) :*: (S1 ('MetaSel ('Just "newVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))))))))) :+: ((((C1 ('MetaCons "DecommitRecorded" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx)) :+: C1 ('MetaCons "DecommitApproved" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "decommitTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx)) :*: S1 ('MetaSel ('Just "utxoToDecommit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))))) :+: (C1 ('MetaCons "DecommitInvalid" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx) :*: S1 ('MetaSel ('Just "decommitInvalidReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (DecommitInvalidReason tx)))) :+: (C1 ('MetaCons "DecommitFinalized" 'PrefixI 'True) ((S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId)) :*: (S1 ('MetaSel ('Just "distributedUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "newVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion))) :+: C1 ('MetaCons "HeadClosed" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber)) :*: (S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime)))))) :+: ((C1 ('MetaCons "HeadContested" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx))) :*: (S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber))) :+: C1 ('MetaCons "HeadIsReadyToFanout" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId))) :+: (C1 ('MetaCons "HeadFanoutInitiated" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "remainingOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :+: (C1 ('MetaCons "HeadPartialFanoutSelected" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "remainingOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "selection") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)))) :+: C1 ('MetaCons "HeadFanoutReverted" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId)))))) :+: (((C1 ('MetaCons "HeadFannedOut" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: (S1 ('MetaSel ('Just "finalizedOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)))) :+: C1 ('MetaCons "HeadPartialFannedOut" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "distributedOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :*: (S1 ('MetaSel ('Just "remainingOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: (S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx)) :*: S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (FanoutMode tx)))))) :+: (C1 ('MetaCons "ChainRolledBack" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainStateType tx))) :+: (C1 ('MetaCons "TickObserved" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ChainPointType tx)) :*: S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime)) :+: C1 ('MetaCons "IgnoredHeadInitializing" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "contestationPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ContestationPeriod)) :*: (S1 ('MetaSel ('Just "parties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Party]) :*: S1 ('MetaSel ('Just "participants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [OnChainId])))))) :+: ((C1 ('MetaCons "TxInvalid" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "utxo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :*: (S1 ('MetaSel ('Just "transaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx) :*: S1 ('MetaSel ('Just "validationError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ValidationError))) :+: C1 ('MetaCons "LocalStateCleared" 'PrefixI 'True) (S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "snapshotNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber))) :+: (C1 ('MetaCons "Checkpoint" 'PrefixI 'True) (S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (NodeState tx))) :+: (C1 ('MetaCons "NodeUnsynced" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainSlot) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "drift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NominalDiffTime))) :+: C1 ('MetaCons "NodeSynced" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainSlot) :*: (S1 ('MetaSel ('Just "chainTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "drift") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NominalDiffTime)))))))))

data Outcome tx Source #

Constructors

Continue

Continue with the given state updates and side effects.

Fields

Wait

Wait for some condition to be met with optional state updates.

Error

Processing resulted in an error.

Fields

Instances

Instances details
IsChainState tx => ToJSON (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

toJSON :: Outcome tx -> Value

toEncoding :: Outcome tx -> Encoding

toJSONList :: [Outcome tx] -> Value

toEncodingList :: [Outcome tx] -> Encoding

omitField :: Outcome tx -> Bool

Semigroup (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

(<>) :: Outcome tx -> Outcome tx -> Outcome tx Source #

sconcat :: NonEmpty (Outcome tx) -> Outcome tx Source #

stimes :: Integral b => b -> Outcome tx -> Outcome tx Source #

Generic (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Associated Types

type Rep (Outcome tx) :: Type -> Type Source #

Methods

from :: Outcome tx -> Rep (Outcome tx) x Source #

to :: Rep (Outcome tx) x -> Outcome tx Source #

IsChainState tx => Show (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

IsChainState tx => Eq (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

(==) :: Outcome tx -> Outcome tx -> Bool Source #

(/=) :: Outcome tx -> Outcome tx -> Bool Source #

type Rep (Outcome tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

type Rep (Outcome tx) = D1 ('MetaData "Outcome" "Hydra.HeadLogic.Outcome" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "Continue" 'PrefixI 'True) (S1 ('MetaSel ('Just "stateChanges") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [StateChanged tx]) :*: S1 ('MetaSel ('Just "effects") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Effect tx])) :+: (C1 ('MetaCons "Wait" 'PrefixI 'True) (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (WaitReason tx)) :*: S1 ('MetaSel ('Just "stateChanges") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [StateChanged tx])) :+: C1 ('MetaCons "Error" 'PrefixI 'True) (S1 ('MetaSel ('Just "error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (LogicError tx)))))

causes :: [Effect tx] -> Outcome tx Source #

data WaitReason tx Source #

Instances

Instances details
IsTx tx => ToJSON (WaitReason tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

toJSON :: WaitReason tx -> Value

toEncoding :: WaitReason tx -> Encoding

toJSONList :: [WaitReason tx] -> Value

toEncodingList :: [WaitReason tx] -> Encoding

omitField :: WaitReason tx -> Bool

Generic (WaitReason tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Associated Types

type Rep (WaitReason tx) :: Type -> Type Source #

Methods

from :: WaitReason tx -> Rep (WaitReason tx) x Source #

to :: Rep (WaitReason tx) x -> WaitReason tx Source #

IsTx tx => Show (WaitReason tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

IsTx tx => Eq (WaitReason tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

Methods

(==) :: WaitReason tx -> WaitReason tx -> Bool Source #

(/=) :: WaitReason tx -> WaitReason tx -> Bool Source #

type Rep (WaitReason tx) Source # 
Instance details

Defined in Hydra.HeadLogic.Outcome

type Rep (WaitReason tx) = D1 ('MetaData "WaitReason" "Hydra.HeadLogic.Outcome" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (((C1 ('MetaCons "WaitOnNotApplicableTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "validationError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ValidationError)) :+: (C1 ('MetaCons "WaitOnSnapshotNumber" 'PrefixI 'True) (S1 ('MetaSel ('Just "waitingForNumber") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber)) :+: C1 ('MetaCons "WaitOnSnapshotVersion" 'PrefixI 'True) (S1 ('MetaSel ('Just "waitingForVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion)))) :+: (C1 ('MetaCons "WaitOnSeenSnapshot" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "WaitOnTxs" 'PrefixI 'True) (S1 ('MetaSel ('Just "waitingForTxIds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [TxIdType tx])) :+: C1 ('MetaCons "WaitOnContestationDeadline" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "WaitOnNotApplicableDecommitTx" 'PrefixI 'True) (S1 ('MetaSel ('Just "notApplicableReason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (DecommitInvalidReason tx))) :+: (C1 ('MetaCons "WaitOnUnresolvedCommit" 'PrefixI 'True) (S1 ('MetaSel ('Just "commitUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "WaitOnUnresolvedDecommit" 'PrefixI 'True) (S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 tx)))) :+: (C1 ('MetaCons "WaitOnDepositObserved" 'PrefixI 'True) (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :+: (C1 ('MetaCons "WaitOnDepositActivation" 'PrefixI 'True) (S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TxIdType tx))) :+: C1 ('MetaCons "WaitOnNodeInSync" 'PrefixI 'True) (S1 ('MetaSel ('Just "currentSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ChainSlot))))))