ouroboros-network-protocols-0.8.1.0: Ouroboros Network Protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Network.Protocol.LocalTxSubmission.Client

Description

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

Protocol type for the client

The protocol states from the point of view of the client.

newtype LocalTxSubmissionClient tx reject m a Source #

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.

Constructors

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.

Constructors

SubmitSuccess 
SubmitFail reason 

Instances

Instances details
Functor SubmitResult Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type

Methods

fmap ∷ (a → b) → SubmitResult a → SubmitResult b #

(<$) ∷ a → SubmitResult b → SubmitResult a #

Eq reason ⇒ Eq (SubmitResult reason) Source # 
Instance details

Defined in Ouroboros.Network.Protocol.LocalTxSubmission.Type

Methods

(==)SubmitResult reason → SubmitResult reason → Bool #

(/=)SubmitResult reason → SubmitResult reason → Bool #

Execution as a typed protocol

localTxSubmissionClientPeer ∷ ∀ 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

localTxSubmissionClientNullMonadTimer 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 ∷ ∀ 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.