Safe Haskell | None |
---|---|
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 :: Type -> Type) a where
- TxSubmissionServerPipelined :: forall (m :: Type -> Type) txid tx a. m (ServerStIdle 'Z txid tx m a) -> TxSubmissionServerPipelined txid tx m a
- data ServerStIdle (n :: N) txid tx (m :: Type -> Type) a where
- SendMsgRequestTxIdsBlocking :: forall (m :: Type -> Type) a txid tx. NumTxIdsToAck -> NumTxIdsToReq -> m a -> (NonEmpty (txid, SizeInBytes) -> m (ServerStIdle 'Z txid tx m a)) -> ServerStIdle 'Z txid tx m a
- SendMsgRequestTxIdsPipelined :: forall (m :: Type -> Type) (n :: N) txid tx a. NumTxIdsToAck -> NumTxIdsToReq -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a
- SendMsgRequestTxsPipelined :: forall txid (m :: Type -> Type) (n :: N) tx a. [txid] -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a
- CollectPipelined :: forall (n1 :: N) txid tx (m :: Type -> Type) a. Maybe (ServerStIdle ('S n1) txid tx m a) -> (Collect txid tx -> m (ServerStIdle n1 txid tx m a)) -> ServerStIdle ('S n1) txid tx m a
- data Collect txid tx
- = CollectTxIds NumTxIdsToReq [(txid, SizeInBytes)]
- | CollectTxs [txid] [tx]
- txSubmissionServerPeerPipelined :: forall txid tx (m :: Type -> Type) a. Functor m => TxSubmissionServerPipelined txid tx m a -> ServerPipelined (TxSubmission2 txid tx) ('StInit :: TxSubmission2 txid tx) m a
- type TxSizeInBytes = SizeInBytes
Protocol type for the server
The protocol states from the point of view of the server.
data TxSubmissionServerPipelined txid tx (m :: Type -> Type) a where Source #
TxSubmissionServerPipelined :: forall (m :: Type -> Type) txid tx a. m (ServerStIdle 'Z txid tx m a) -> TxSubmissionServerPipelined txid tx m a |
data ServerStIdle (n :: N) txid tx (m :: Type -> Type) a where Source #
SendMsgRequestTxIdsBlocking | |
| |
SendMsgRequestTxIdsPipelined :: forall (m :: Type -> Type) (n :: N) txid tx a. NumTxIdsToAck -> NumTxIdsToReq -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a | |
SendMsgRequestTxsPipelined :: forall txid (m :: Type -> Type) (n :: N) tx a. [txid] -> m (ServerStIdle ('S n) txid tx m a) -> ServerStIdle n txid tx m a | |
CollectPipelined :: forall (n1 :: N) txid tx (m :: Type -> Type) a. Maybe (ServerStIdle ('S n1) txid tx m a) -> (Collect txid tx -> m (ServerStIdle n1 txid tx m a)) -> ServerStIdle ('S n1) 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 NumTxIdsToReq [(txid, SizeInBytes)] | The result of |
CollectTxs [txid] [tx] | The result of |
Execution as a typed protocol
txSubmissionServerPeerPipelined :: forall txid tx (m :: Type -> Type) a. Functor m => TxSubmissionServerPipelined txid tx m a -> ServerPipelined (TxSubmission2 txid tx) ('StInit :: TxSubmission2 txid tx) m a Source #
Transform a TxSubmissionServerPipelined
into a PeerPipelined
.
deprecated API
type TxSizeInBytes = SizeInBytes Source #
Deprecated: Use SizeInBytes
instead
Transactions are typically not big, but in principle in future we could have ones over 64k large.