Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data TimedServerOutput tx = TimedServerOutput {}
- genTimedServerOutput :: ServerOutput tx -> Gen (TimedServerOutput tx)
- data DecommitInvalidReason tx
- = DecommitTxInvalid {
- localUTxO :: UTxOType tx
- validationError :: ValidationError
- | DecommitAlreadyInFlight {
- otherDecommitTxId :: TxIdType tx
- = DecommitTxInvalid {
- data ServerOutput tx
- = PeerConnected { }
- | PeerDisconnected { }
- | PeerHandshakeFailure {
- remoteHost :: Host
- ourVersion :: Natural
- theirVersions :: [Natural]
- | HeadIsInitializing { }
- | Committed { }
- | HeadIsOpen { }
- | HeadIsClosed {
- headId :: HeadId
- snapshotNumber :: SnapshotNumber
- contestationDeadline :: UTCTime
- | HeadIsContested {
- headId :: HeadId
- snapshotNumber :: SnapshotNumber
- contestationDeadline :: UTCTime
- | ReadyToFanout {
- headId :: HeadId
- | HeadIsAborted { }
- | HeadIsFinalized { }
- | CommandFailed {
- clientInput :: ClientInput tx
- state :: HeadState tx
- | TxValid {
- headId :: HeadId
- transaction :: tx
- | TxInvalid {
- headId :: HeadId
- utxo :: UTxOType tx
- transaction :: tx
- validationError :: ValidationError
- | SnapshotConfirmed {
- headId :: HeadId
- snapshot :: Snapshot tx
- signatures :: MultiSignature (Snapshot tx)
- | GetUTxOResponse { }
- | InvalidInput { }
- | Greetings {
- me :: Party
- headStatus :: HeadStatus
- hydraHeadId :: Maybe HeadId
- snapshotUtxo :: Maybe (UTxOType tx)
- hydraNodeVersion :: String
- | PostTxOnChainFailed {
- postChainTx :: PostChainTx tx
- postTxError :: PostTxError tx
- | IgnoredHeadInitializing {
- headId :: HeadId
- contestationPeriod :: ContestationPeriod
- parties :: [Party]
- participants :: [OnChainId]
- | DecommitRequested {
- headId :: HeadId
- decommitTx :: tx
- utxoToDecommit :: UTxOType tx
- | DecommitInvalid {
- headId :: HeadId
- decommitTx :: tx
- decommitInvalidReason :: DecommitInvalidReason tx
- | DecommitApproved {
- headId :: HeadId
- decommitTxId :: TxIdType tx
- utxoToDecommit :: UTxOType tx
- | DecommitFinalized {
- headId :: HeadId
- decommitTxId :: TxIdType tx
- data WithUTxO
- newtype ServerOutputConfig = ServerOutputConfig {}
- prepareServerOutput :: IsChainState tx => ServerOutputConfig -> TimedServerOutput tx -> ByteString
- data HeadStatus
- = Idle
- | Initializing
- | Open
- | Closed
- | FanoutPossible
- | Final
- projectInitializingHeadId :: Maybe HeadId -> ServerOutput tx -> Maybe HeadId
- projectHeadStatus :: HeadStatus -> ServerOutput tx -> HeadStatus
- projectSnapshotUtxo :: Maybe (UTxOType tx) -> ServerOutput tx -> Maybe (UTxOType tx)
Documentation
data TimedServerOutput tx Source #
The type of messages sent to clients by the Server
.
Instances
genTimedServerOutput :: ServerOutput tx -> Gen (TimedServerOutput tx) Source #
Generate a random timed server output given a normal server output.
data DecommitInvalidReason tx Source #
DecommitTxInvalid | |
| |
DecommitAlreadyInFlight | |
|
Instances
data ServerOutput tx Source #
Individual server output messages as produced by the HeadLogic
in
the ClientEffect
.
PeerConnected | |
PeerDisconnected | |
PeerHandshakeFailure | |
| |
HeadIsInitializing | |
Committed | |
HeadIsOpen | |
HeadIsClosed | |
| |
HeadIsContested | |
| |
ReadyToFanout | |
| |
HeadIsAborted | |
HeadIsFinalized | |
CommandFailed | |
| |
TxValid | Given transaction has been seen as valid in the Head. It is expected to
eventually be part of a |
| |
TxInvalid | Given transaction was not not applicable to the given UTxO in time and has been dropped. |
| |
SnapshotConfirmed | Given snapshot was confirmed and included transactions can be considered final. |
| |
GetUTxOResponse | |
InvalidInput | |
Greetings | A friendly welcome message which tells a client something about the
node. Currently used for knowing what signing key the server uses (it
only knows one), |
| |
PostTxOnChainFailed | |
| |
IgnoredHeadInitializing | |
| |
DecommitRequested | |
| |
DecommitInvalid | |
| |
DecommitApproved | |
| |
DecommitFinalized | |
|
Instances
Whether or not to include full UTxO in server outputs.
newtype ServerOutputConfig Source #
Instances
Show ServerOutputConfig Source # | |
Defined in Hydra.API.ServerOutput | |
Eq ServerOutputConfig Source # | |
Defined in Hydra.API.ServerOutput (==) :: ServerOutputConfig -> ServerOutputConfig -> Bool Source # (/=) :: ServerOutputConfig -> ServerOutputConfig -> Bool Source # |
:: IsChainState tx | |
=> ServerOutputConfig | Decide on tx representation |
-> TimedServerOutput tx | Server output |
-> ByteString | Final output |
Replaces the json encoded tx field with it's cbor representation.
NOTE: we deliberately pattern match on all ServerOutput
constructors in
handleTxOutput
so that we don't forget to update this function if they
change.
data HeadStatus Source #
All possible Hydra states displayed in the API server outputs.
Instances
projectInitializingHeadId :: Maybe HeadId -> ServerOutput tx -> Maybe HeadId Source #
Projection to obtain the HeadId
needed to draft a commit transaction.
NOTE: We only want to project HeadId
when the Head is in the Initializing
state since this is when Head parties need to commit some funds.
projectHeadStatus :: HeadStatus -> ServerOutput tx -> HeadStatus Source #
Projection function related to $sel:headStatus:PeerConnected
field in Greetings
message.
projectSnapshotUtxo :: Maybe (UTxOType tx) -> ServerOutput tx -> Maybe (UTxOType tx) Source #
Projection of latest confirmed snapshot UTxO.