diff --git a/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Direct.hs b/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Direct.hs index 8002351fc90..50e7212cfe4 100644 --- a/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Direct.hs +++ b/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Direct.hs @@ -53,7 +53,8 @@ directPipelined (TxSubmissionServerPipelined mserver) directSender q (SendMsgRequestTxsPipelined txids serverNext) ClientStIdle{recvMsgRequestTxs} = do server' <- serverNext - SendMsgReplyTxs txs client' <- recvMsgRequestTxs txids + SendMsgReplyTxs txs mClient' <- recvMsgRequestTxs txids + client' <- mClient' directSender (enqueue (CollectTxs txids txs) q) server' client' directSender q (CollectPipelined (Just server') _) client = diff --git a/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Examples.hs b/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Examples.hs index 7e1dbf0061f..16759ba2799 100644 --- a/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Examples.hs +++ b/ouroboros-network/protocol-tests/Ouroboros/Network/Protocol/TxSubmission/Examples.hs @@ -141,7 +141,7 @@ txSubmissionClient tracer txId txSize maxUnacked = traceWith tracer (EventRecvMsgRequestTxs unackedSeq unackedMap remainingTxs txids) case [ txid | txid <- txids, txid `Map.notMember` unackedMap ] of - [] -> pure (SendMsgReplyTxs txs client') + [] -> pure (SendMsgReplyTxs txs (pure client')) where txs = map (unackedMap Map.!) txids client' = client unackedSeq unackedMap' remainingTxs diff --git a/ouroboros-network/src/Ouroboros/Network/Protocol/TxSubmission/Client.hs b/ouroboros-network/src/Ouroboros/Network/Protocol/TxSubmission/Client.hs index 3826d6fcacd..dc8a8e194e4 100644 --- a/ouroboros-network/src/Ouroboros/Network/Protocol/TxSubmission/Client.hs +++ b/ouroboros-network/src/Ouroboros/Network/Protocol/TxSubmission/Client.hs @@ -80,7 +80,7 @@ data ClientStTxIds blocking txid tx m a where data ClientStTxs txid tx m a where SendMsgReplyTxs :: [tx] - -> ClientStIdle txid tx m a + -> m (ClientStIdle txid tx m a) -> ClientStTxs txid tx m a @@ -113,5 +113,4 @@ txSubmissionClientPeer (TxSubmissionClient client) = SendMsgReplyTxs txs k <- recvMsgRequestTxs txids return $ Yield (ClientAgency TokTxs) (MsgReplyTxs txs) - (go k) - + (Effect $ k >>= return . go) diff --git a/ouroboros-network/src/Ouroboros/Network/TxSubmission/Outbound.hs b/ouroboros-network/src/Ouroboros/Network/TxSubmission/Outbound.hs index 9a9027138e1..2f720c1f8ce 100644 --- a/ouroboros-network/src/Ouroboros/Network/TxSubmission/Outbound.hs +++ b/ouroboros-network/src/Ouroboros/Network/TxSubmission/Outbound.hs @@ -189,7 +189,7 @@ txSubmissionOutbound tracer maxUnacked TxSubmissionMempoolReader{..} = !unackedMap' = foldl' (flip Map.delete) unackedMap txids client' = client unackedSeq unackedMap' lastIdx - -- Trace the transactions to be sent in the response. - traceWith tracer (TraceTxSubmissionOutboundSendMsgReplyTxs txs) + -- Trace the transactions to be sent in the response. + traceTxsSent = traceWith tracer (TraceTxSubmissionOutboundSendMsgReplyTxs txs) - return $ SendMsgReplyTxs txs client' + return $ SendMsgReplyTxs txs (traceTxsSent >> pure client')