Safe Haskell | None |
---|---|
Language | Haskell2010 |
A view of the transaction submission protocol from the point of view of the client.
This provides a view that uses less complex types and should be easier to use than the underlying typed protocol itself.
For execution,
localTxSubmissionClientPeer
is provided for conversion
into the typed protocol.
Synopsis
-
newtype
LocalTxSubmissionClient
tx reject m a =
LocalTxSubmissionClient
{
- runLocalTxSubmissionClient :: m ( LocalTxClientStIdle tx reject m a)
-
data
LocalTxClientStIdle
tx reject m a
where
- SendMsgSubmitTx :: tx -> ( SubmitResult reject -> m ( LocalTxClientStIdle tx reject m a)) -> LocalTxClientStIdle tx reject m a
- SendMsgDone :: a -> LocalTxClientStIdle tx reject m a
-
data
SubmitResult
reason
- = SubmitSuccess
- | SubmitFail reason
- localTxSubmissionClientPeer :: forall tx reject m a. Monad m => LocalTxSubmissionClient tx reject m a -> Peer ( LocalTxSubmission tx reject) AsClient StIdle m a
- localTxSubmissionClientNull :: MonadTimer m => LocalTxSubmissionClient tx reject m a
- mapLocalTxSubmissionClient :: forall tx tx' reject reject' m a. Functor m => (tx -> tx') -> (reject' -> reject) -> LocalTxSubmissionClient tx reject m a -> LocalTxSubmissionClient tx' reject' m a
Protocol type for the client
The protocol states from the point of view of the client.
newtype LocalTxSubmissionClient tx reject m a Source #
LocalTxSubmissionClient | |
|
data LocalTxClientStIdle tx reject m a where Source #
The client side of the local transaction submission protocol.
The peer in the client role submits transactions to the peer in the server role.
SendMsgSubmitTx :: tx -> ( SubmitResult reject -> m ( LocalTxClientStIdle tx reject m a)) -> LocalTxClientStIdle tx reject m a |
The client submits a single transaction and waits a reply. The server replies to inform the client that it has either accepted the transaction or rejected it. In the rejection case a reason for the rejection is included. |
SendMsgDone :: a -> LocalTxClientStIdle tx reject m a |
The client can terminate the protocol. |
The result from a transaction submission.
data SubmitResult reason Source #
Isomorphic with Maybe but with a name that better describes its purpose and usage.
SubmitSuccess | |
SubmitFail reason |
Instances
Functor SubmitResult Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type fmap :: (a -> b) -> SubmitResult a -> SubmitResult b Source # (<$) :: a -> SubmitResult b -> SubmitResult a Source # |
|
Eq reason => Eq ( SubmitResult reason) Source # | |
Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type (==) :: SubmitResult reason -> SubmitResult reason -> Bool Source # (/=) :: SubmitResult reason -> SubmitResult reason -> Bool Source # |
Execution as a typed protocol
localTxSubmissionClientPeer :: forall tx reject m a. Monad m => LocalTxSubmissionClient tx reject m a -> Peer ( LocalTxSubmission tx reject) AsClient StIdle m a Source #
A non-pipelined
Peer
representing the
LocalTxSubmissionClient
.
Null local tx submission client
localTxSubmissionClientNull :: MonadTimer m => LocalTxSubmissionClient tx reject m a Source #
Deprecated: Use Ouroboros.Network.NodeToClient.localTxSubmissionPeerNull
A local tx submission client which never sends any message.
Utilities
mapLocalTxSubmissionClient :: forall tx tx' reject reject' m a. Functor m => (tx -> tx') -> (reject' -> reject) -> LocalTxSubmissionClient tx reject m a -> LocalTxSubmissionClient tx' reject' m a Source #
Transform a
LocalTxSubmissionClient
by mapping over the tx and the
rejection errors.
Note the direction of the individual mapping functions corresponds to whether the types are used as protocol inputs or outputs.