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
- transactionId :: TxIdType tx
- 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
- | CommitRecorded {
- headId :: HeadId
- utxoToCommit :: UTxOType tx
- pendingDeposit :: TxIdType tx
- deadline :: UTCTime
- | CommitApproved {
- headId :: HeadId
- utxoToCommit :: UTxOType tx
- | DecommitFinalized {
- headId :: HeadId
- decommitTxId :: TxIdType tx
- | CommitFinalized {
- headId :: HeadId
- theDeposit :: TxIdType tx
- | CommitRecovered {
- headId :: HeadId
- recoveredUTxO :: UTxOType tx
- recoveredTxId :: TxIdType tx
- data WithUTxO
- data WithAddressedTx
- data ServerOutputConfig = ServerOutputConfig {}
- prepareServerOutput :: IsChainState tx => ServerOutputConfig -> TimedServerOutput tx -> ByteString
- data HeadStatus
- = Idle
- | Initializing
- | Open
- | Closed
- | FanoutPossible
- | Final
- data CommitInfo
- = CannotCommit
- | NormalCommit HeadId
- | IncrementalCommit HeadId
- projectPendingDeposits :: IsTx tx => [TxIdType tx] -> ServerOutput tx -> [TxIdType tx]
- projectCommitInfo :: CommitInfo -> ServerOutput tx -> CommitInfo
- 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 | |
| |
CommitRecorded | |
| |
CommitApproved | |
| |
DecommitFinalized | |
| |
CommitFinalized | |
| |
CommitRecovered | |
|
Instances
Whether or not to include full UTxO in server outputs.
data WithAddressedTx Source #
Whether or not to filter transaction server outputs by given address.
Instances
Show WithAddressedTx Source # | |
Defined in Hydra.API.ServerOutput | |
Eq WithAddressedTx Source # | |
Defined in Hydra.API.ServerOutput (==) :: WithAddressedTx -> WithAddressedTx -> Bool Source # (/=) :: WithAddressedTx -> WithAddressedTx -> Bool Source # |
data 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
data CommitInfo Source #
All information needed to distinguish behavior of the commit endpoint.
CannotCommit | |
NormalCommit HeadId | |
IncrementalCommit HeadId |
projectPendingDeposits :: IsTx tx => [TxIdType tx] -> ServerOutput tx -> [TxIdType tx] Source #
Projection to obtain the list of pending deposits.
projectCommitInfo :: CommitInfo -> ServerOutput tx -> CommitInfo Source #
Projection to obtain CommitInfo
needed to draft commit transactions.
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.
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.