Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A view of the transaction submission protocol from the point of view of the server.
This provides a view that uses less complex types and should be easier to use than the underlying typed protocol itself.
For execution, a conversion into the typed protocol is provided.
Synopsis
- data TxSubmissionServerPipelined txid tx m a where
- TxSubmissionServerPipelined ∷ m (ServerStIdle Z txid tx m a) → TxSubmissionServerPipelined txid tx m a
- data ServerStIdle (n ∷ N) txid tx m a where
- SendMsgRequestTxIdsBlocking ∷ Word16 → Word16 → m a → (NonEmpty (txid, TxSizeInBytes) → m (ServerStIdle Z txid tx m a)) → ServerStIdle Z txid tx m a
- SendMsgRequestTxIdsPipelined ∷ Word16 → Word16 → m (ServerStIdle (S n) txid tx m a) → ServerStIdle n txid tx m a
- SendMsgRequestTxsPipelined ∷ [txid] → m (ServerStIdle (S n) txid tx m a) → ServerStIdle n txid tx m a
- CollectPipelined ∷ Maybe (ServerStIdle (S n) txid tx m a) → (Collect txid tx → m (ServerStIdle n txid tx m a)) → ServerStIdle (S n) txid tx m a
- data Collect txid tx
- = CollectTxIds Word16 [(txid, TxSizeInBytes)]
- | CollectTxs [txid] [tx]
- type TxSizeInBytes = Word32
- txSubmissionServerPeerPipelined ∷ ∀ txid tx m a. Functor m ⇒ TxSubmissionServerPipelined txid tx m a → PeerPipelined (TxSubmission2 txid tx) AsServer StInit m a
Protocol type for the server
The protocol states from the point of view of the server.
data TxSubmissionServerPipelined txid tx m a where Source #
TxSubmissionServerPipelined ∷ m (ServerStIdle Z txid tx m a) → TxSubmissionServerPipelined txid tx m a |
data ServerStIdle (n ∷ N) txid tx m a where Source #
SendMsgRequestTxIdsBlocking | |
| |
SendMsgRequestTxIdsPipelined ∷ Word16 → Word16 → m (ServerStIdle (S n) txid tx m a) → ServerStIdle n txid tx m a | |
SendMsgRequestTxsPipelined ∷ [txid] → m (ServerStIdle (S n) txid tx m a) → ServerStIdle n txid tx m a | |
CollectPipelined ∷ Maybe (ServerStIdle (S n) txid tx m a) → (Collect txid tx → m (ServerStIdle n txid tx m a)) → ServerStIdle (S n) txid tx m a | Collect a pipelined result. |
This is the type of the pipelined results, collected by CollectPipelined
.
This protocol can pipeline requests for transaction ids and transactions,
so we use a sum of either for collecting the responses.
CollectTxIds Word16 [(txid, TxSizeInBytes)] | The result of |
CollectTxs [txid] [tx] | The result of |
type TxSizeInBytes = Word32 Source #
Transactions are typically not big, but in principle in future we could have ones over 64k large.
Execution as a typed protocol
txSubmissionServerPeerPipelined ∷ ∀ txid tx m a. Functor m ⇒ TxSubmissionServerPipelined txid tx m a → PeerPipelined (TxSubmission2 txid tx) AsServer StInit m a Source #
Transform a TxSubmissionServerPipelined
into a PeerPipelined
.