hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.HeadLogic.State

Synopsis

Documentation

data HeadState tx Source #

The main state of the Hydra protocol state machine. It holds both, the overall protocol state, but also the off-chain CoordinatedHeadState.

Each of the sub-types (OpenState, etc.) contain a black-box IdleState corresponding to the ChainEvent that has been observed leading to the state.

Note that rollbacks are currently not fully handled in the head logic and only this internal chain state gets replaced with the "rolled back to" version.

TODO: chainState would actually not be needed in the HeadState anymore as we do not persist the HeadState and not access it in the HeadLogic either.

Constructors

Idle (IdleState tx) 
Open (OpenState tx) 
Closed (ClosedState tx) 
FanoutProgress (PartialFanoutState tx)

A closed head whose UTxO is being fanned out across multiple transactions (on-chain in the FanoutProgress state). Reached from Closed once the first partial fanout is observed.

Instances

Instances details
(IsTx tx, FromJSON (ChainStateType tx)) => FromJSON (HeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (HeadState tx)

parseJSONList :: Value -> Parser [HeadState tx]

omittedField :: Maybe (HeadState tx)

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

Defined in Hydra.HeadLogic.State

Methods

toJSON :: HeadState tx -> Value

toEncoding :: HeadState tx -> Encoding

toJSONList :: [HeadState tx] -> Value

toEncodingList :: [HeadState tx] -> Encoding

omitField :: HeadState tx -> Bool

Generic (HeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

Methods

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

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

(IsTx tx, Show (ChainStateType tx)) => Show (HeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

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

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (HeadState tx)

label :: Proxy (HeadState tx) -> Text

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

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: HeadState tx -> Encoding

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

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

(IsTx tx, Eq (ChainStateType tx)) => Eq (HeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

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

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

type Rep (HeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

setChainState :: ChainStateType tx -> HeadState tx -> HeadState tx Source #

Update the chain state in any HeadState.

getChainState :: HeadState tx -> ChainStateType tx Source #

Get the chain state in any HeadState.

getHeadParameters :: HeadState tx -> Maybe HeadParameters Source #

Get the head parameters in any HeadState.

getOpenStateConfirmedSnapshot :: HeadState tx -> Maybe (ConfirmedSnapshot tx) Source #

Get the head parameters in any HeadState.

Idle

newtype IdleState tx Source #

An Idle head only having a chain state with things seen on chain so far.

Constructors

IdleState 

Fields

Instances

Instances details
FromJSON (ChainStateType tx) => FromJSON (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (IdleState tx)

parseJSONList :: Value -> Parser [IdleState tx]

omittedField :: Maybe (IdleState tx)

ToJSON (ChainStateType tx) => ToJSON (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toJSON :: IdleState tx -> Value

toEncoding :: IdleState tx -> Encoding

toJSONList :: [IdleState tx] -> Value

toEncodingList :: [IdleState tx] -> Encoding

omitField :: IdleState tx -> Bool

Generic (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

Methods

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

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

Show (ChainStateType tx) => Show (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

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

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (IdleState tx)

label :: Proxy (IdleState tx) -> Text

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

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: IdleState tx -> Encoding

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

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

Eq (ChainStateType tx) => Eq (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

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

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

type Rep (IdleState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (IdleState tx) = D1 ('MetaData "IdleState" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'True) (C1 ('MetaCons "IdleState" 'PrefixI 'True) (S1 ('MetaSel ('Just "chainState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ChainStateType tx))))

Open

data OpenState tx Source #

An Open head with a CoordinatedHeadState tracking off-chain transactions.

Constructors

OpenState 

Fields

Instances

Instances details
(IsTx tx, FromJSON (ChainStateType tx)) => FromJSON (OpenState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (OpenState tx)

parseJSONList :: Value -> Parser [OpenState tx]

omittedField :: Maybe (OpenState tx)

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

Defined in Hydra.HeadLogic.State

Methods

toJSON :: OpenState tx -> Value

toEncoding :: OpenState tx -> Encoding

toJSONList :: [OpenState tx] -> Value

toEncodingList :: [OpenState tx] -> Encoding

omitField :: OpenState tx -> Bool

Generic (OpenState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

Methods

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

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

(IsTx tx, Show (ChainStateType tx)) => Show (OpenState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

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

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (OpenState tx)

label :: Proxy (OpenState tx) -> Text

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

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: OpenState tx -> Encoding

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

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

(IsTx tx, Eq (ChainStateType tx)) => Eq (OpenState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

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

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

type Rep (OpenState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (OpenState tx) = D1 ('MetaData "OpenState" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "OpenState" 'PrefixI 'True) ((S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadParameters) :*: S1 ('MetaSel ('Just "coordinatedHeadState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (CoordinatedHeadState tx))) :*: (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)))))

data CoordinatedHeadState tx Source #

Off-chain state of the Coordinated Head protocol.

Constructors

CoordinatedHeadState 

Fields

  • localUTxO :: UTxOType tx

    The latest UTxO resulting from applying $sel:localTxs:CoordinatedHeadState to CoordinatedHeadState. Spec: L̂

  • localTxs :: Seq tx

    Sequence of transactions applied locally and pending inclusion in a snapshot. Ordering is important as transactions are added in order of application. Spec: T̂

  • allTxs :: !(Map (TxIdType tx) tx)

    Map containing all the transactions ever seen by this node and not yet included in a snapshot. Spec: Tall

  • confirmedSnapshot :: ConfirmedSnapshot tx

    The latest confirmed snapshot. Spec: S̅

  • seenSnapshot :: SeenSnapshot tx

    Last seen snapshot and signatures accumulator. Spec: Û, ŝ and Σ̂

  • currentDepositTxId :: Maybe (TxIdType tx)

    Current/next deposit to incrementally commit. Spec: Uα TODO: update in spec: Uα -> tx^#α

  • decommitTx :: Maybe tx

    Pending decommit transaction. Spec: txω

  • version :: SnapshotVersion

    Last open state version as observed on chain. Spec: ̂v

Instances

Instances details
IsTx tx => FromJSON (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (CoordinatedHeadState tx)

parseJSONList :: Value -> Parser [CoordinatedHeadState tx]

omittedField :: Maybe (CoordinatedHeadState tx)

IsTx tx => ToJSON (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Generic (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

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

Defined in Hydra.HeadLogic.State

IsTx tx => FromCBOR (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (CoordinatedHeadState tx)

label :: Proxy (CoordinatedHeadState tx) -> Text

IsTx tx => ToCBOR (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: CoordinatedHeadState tx -> Encoding

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

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

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

Defined in Hydra.HeadLogic.State

type Rep (CoordinatedHeadState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (CoordinatedHeadState tx) = D1 ('MetaData "CoordinatedHeadState" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "CoordinatedHeadState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "localUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "localTxs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Seq tx))) :*: (S1 ('MetaSel ('Just "allTxs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map (TxIdType tx) tx)) :*: S1 ('MetaSel ('Just "confirmedSnapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ConfirmedSnapshot tx)))) :*: ((S1 ('MetaSel ('Just "seenSnapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (SeenSnapshot tx)) :*: S1 ('MetaSel ('Just "currentDepositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (TxIdType tx)))) :*: (S1 ('MetaSel ('Just "decommitTx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe tx)) :*: S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion)))))

data SeenSnapshot tx Source #

Data structure to help in tracking whether we have seen or requested a ReqSn already and if seen, the signatures we collected already.

Constructors

NoSeenSnapshot

Never saw a ReqSn.

LastSeenSnapshot

No snapshot in flight with last seen snapshot number as given.

Fields

RequestedSnapshot

ReqSn was sent out and it should be considered already in flight.

Fields

SeenSnapshot

ReqSn for given snapshot was received.

Fields

  • snapshot :: Snapshot tx
     
  • signatories :: Map Party (Signature (Snapshot tx))

    Collected signatures so far.

  • signableBytes :: ~ByteString

    Pre-computed result of 'getSignableRepresentation snapshot', cached to avoid recomputing the expensive UTxO hash on every AckSn verification. Explicitly lazy under StrictData: state hydration folds every historical NodeState to WHNF, and a strict field here would force one full accumulator commitment per replayed SnapshotRequested event. At runtime it is forced once, on the first AckSn.

Instances

Instances details
IsTx tx => FromJSON (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (SeenSnapshot tx)

parseJSONList :: Value -> Parser [SeenSnapshot tx]

omittedField :: Maybe (SeenSnapshot tx)

IsTx tx => ToJSON (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toJSON :: SeenSnapshot tx -> Value

toEncoding :: SeenSnapshot tx -> Encoding

toJSONList :: [SeenSnapshot tx] -> Value

toEncodingList :: [SeenSnapshot tx] -> Encoding

omitField :: SeenSnapshot tx -> Bool

Generic (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

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

Defined in Hydra.HeadLogic.State

IsTx tx => FromCBOR (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (SeenSnapshot tx)

label :: Proxy (SeenSnapshot tx) -> Text

IsTx tx => ToCBOR (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: SeenSnapshot tx -> Encoding

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

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

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

Defined in Hydra.HeadLogic.State

type Rep (SeenSnapshot tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (SeenSnapshot tx) = D1 ('MetaData "SeenSnapshot" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) ((C1 ('MetaCons "NoSeenSnapshot" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "LastSeenSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "lastSeen") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber))) :+: (C1 ('MetaCons "RequestedSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "lastSeen") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber) :*: S1 ('MetaSel ('Just "requested") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotNumber)) :+: C1 ('MetaCons "SeenSnapshot" 'PrefixI 'True) (S1 ('MetaSel ('Just "snapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Snapshot tx)) :*: (S1 ('MetaSel ('Just "signatories") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Map Party (Signature (Snapshot tx)))) :*: S1 ('MetaSel ('Just "signableBytes") 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 ByteString)))))

mkSeenSnapshot :: IsTx tx => Snapshot tx -> Map Party (Signature (Snapshot tx)) -> SeenSnapshot tx Source #

Smart constructor for SeenSnapshot that computes and caches $sel:signableBytes:NoSeenSnapshot from $sel:snapshot:NoSeenSnapshot, enforcing the invariant that they stay in sync.

seenSnapshotNumber :: SeenSnapshot tx -> SnapshotNumber Source #

Get the last seen snapshot number given a SeenSnapshot.

snapshotInFlight :: SeenSnapshot tx -> Bool Source #

Whether a snapshot is currently in-flight (requested or being signed).

isCollectingAcks :: SeenSnapshot tx -> Bool Source #

Whether AckSns are currently being collected for a snapshot. Unlike snapshotInFlight, returns False for RequestedSnapshot — a snapshot sent but not yet echoed is stale once the version bumps and should not block a fresh request with the new version.

Closed

data ClosedState tx Source #

An Closed head with an current candidate ConfirmedSnapshot, which may be contested before the ClosedState.

Constructors

ClosedState 

Fields

Instances

Instances details
(IsTx tx, FromJSON (ChainStateType tx)) => FromJSON (ClosedState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (ClosedState tx)

parseJSONList :: Value -> Parser [ClosedState tx]

omittedField :: Maybe (ClosedState tx)

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

Defined in Hydra.HeadLogic.State

Methods

toJSON :: ClosedState tx -> Value

toEncoding :: ClosedState tx -> Encoding

toJSONList :: [ClosedState tx] -> Value

toEncodingList :: [ClosedState tx] -> Encoding

omitField :: ClosedState tx -> Bool

Generic (ClosedState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

Methods

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

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

(IsTx tx, Show (ChainStateType tx)) => Show (ClosedState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

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

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (ClosedState tx)

label :: Proxy (ClosedState tx) -> Text

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

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: ClosedState tx -> Encoding

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

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

(IsTx tx, Eq (ChainStateType tx)) => Eq (ClosedState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (ClosedState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (ClosedState tx) = D1 ('MetaData "ClosedState" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "ClosedState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadParameters) :*: S1 ('MetaSel ('Just "confirmedSnapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ConfirmedSnapshot tx))) :*: (S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "readyToFanoutSent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :*: ((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 "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion)))))

PartialFanout

data FanoutMode tx Source #

How the node decides which UTxOs to distribute in the next fanout step while the head is in FanoutProgress.

Constructors

AutoDrain

Entered only via the Fanout client command: drain the whole remaining set automatically, dynamically chunked, ending in the final fanout.

DistributingSelection (UTxOType tx)

Manual mode: keep distributing this (content-tracked) user selection, dynamically chunked, until it is exhausted.

AwaitingSelection

Manual mode: the previous selection has been fully distributed. Wait for the next PartialFanout command; do not auto-drain.

Instances

Instances details
IsTx tx => FromJSON (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (FanoutMode tx)

parseJSONList :: Value -> Parser [FanoutMode tx]

omittedField :: Maybe (FanoutMode tx)

IsTx tx => ToJSON (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toJSON :: FanoutMode tx -> Value

toEncoding :: FanoutMode tx -> Encoding

toJSONList :: [FanoutMode tx] -> Value

toEncodingList :: [FanoutMode tx] -> Encoding

omitField :: FanoutMode tx -> Bool

Generic (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

Methods

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

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

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

Defined in Hydra.HeadLogic.State

IsTx tx => FromCBOR (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (FanoutMode tx)

label :: Proxy (FanoutMode tx) -> Text

IsTx tx => ToCBOR (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: FanoutMode tx -> Encoding

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

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

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

Defined in Hydra.HeadLogic.State

Methods

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

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

type Rep (FanoutMode tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (FanoutMode tx) = D1 ('MetaData "FanoutMode" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "AutoDrain" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DistributingSelection" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx))) :+: C1 ('MetaCons "AwaitingSelection" 'PrefixI 'False) (U1 :: Type -> Type)))

data PartialFanoutState tx Source #

A closed head whose UTxO is being distributed across multiple fanout transactions (on-chain FanoutProgress). Holds the partial-fanout bookkeeping that used to live in ClosedState.

Constructors

PartialFanoutState 

Fields

Instances

Instances details
(IsTx tx, FromJSON (ChainStateType tx)) => FromJSON (PartialFanoutState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Methods

parseJSON :: Value -> Parser (PartialFanoutState tx)

parseJSONList :: Value -> Parser [PartialFanoutState tx]

omittedField :: Maybe (PartialFanoutState tx)

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

Defined in Hydra.HeadLogic.State

Generic (PartialFanoutState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

Associated Types

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

(IsTx tx, Show (ChainStateType tx)) => Show (PartialFanoutState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

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

Defined in Hydra.HeadLogic.State

Methods

fromCBOR :: Decoder s (PartialFanoutState tx)

label :: Proxy (PartialFanoutState tx) -> Text

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

Defined in Hydra.HeadLogic.State

Methods

toCBOR :: PartialFanoutState tx -> Encoding

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

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

(IsTx tx, Eq (ChainStateType tx)) => Eq (PartialFanoutState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (PartialFanoutState tx) Source # 
Instance details

Defined in Hydra.HeadLogic.State

type Rep (PartialFanoutState tx) = D1 ('MetaData "PartialFanoutState" "Hydra.HeadLogic.State" "hydra-node-2.3.0-1cgalYNmLJQC1YXlYVq7mp" 'False) (C1 ('MetaCons "PartialFanoutState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HeadParameters) :*: S1 ('MetaSel ('Just "confirmedSnapshot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ConfirmedSnapshot tx))) :*: (S1 ('MetaSel ('Just "contestationDeadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UTCTime) :*: (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 "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 SnapshotVersion)) :*: (S1 ('MetaSel ('Just "remainingOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: (S1 ('MetaSel ('Just "distributedOutputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (UTxOType tx)) :*: S1 ('MetaSel ('Just "mode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (FanoutMode tx)))))))