From 6eda3fb03c337dc042634ec6042b4c29d4b2550a Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 8 Aug 2023 18:33:53 +0200 Subject: [PATCH] TxSubmission: removed the Hello transformer We used it to transform TxSubmission v1 into v2, but this is no longer the case. --- .../Protocol/TxSubmission/Hello/Codec.hs | 72 ------------------- .../Protocol/TxSubmission/Hello/Type.hs | 24 ------- 2 files changed, 96 deletions(-) delete mode 100644 ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Codec.hs delete mode 100644 ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Type.hs diff --git a/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Codec.hs b/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Codec.hs deleted file mode 100644 index 8d2d4d1dd5e..00000000000 --- a/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Codec.hs +++ /dev/null @@ -1,72 +0,0 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RankNTypes #-} - -module Ouroboros.Network.Protocol.TxSubmission2.Hello.Codec - ( codecTxSubmission2 - , codecTxSubmission2Id - , byteLimitsTxSubmission2 - , timeLimitsTxSubmission2 - ) where - -import Control.Monad.Class.MonadST - -import qualified Codec.CBOR.Decoding as CBOR -import qualified Codec.CBOR.Encoding as CBOR -import qualified Codec.CBOR.Read as CBOR -import Data.ByteString.Lazy (ByteString) - -import Network.TypedProtocol.Codec.CBOR - -import Ouroboros.Network.Driver.Limits -import Ouroboros.Network.Protocol.Trans.Hello.Codec -import Ouroboros.Network.Protocol.TxSubmission.Codec -import Ouroboros.Network.Protocol.TxSubmission2.Hello.Type -import Ouroboros.Network.Util.ShowProxy - - --- | Byte Limits. --- --- Preserves byte limits of the original 'TxSubmission' protocol, see --- 'timeLimitsTxSubmission'. 'MsgHello' is using 'smallByteLimit' limit. --- -byteLimitsTxSubmission2 :: forall bytes txid tx. - (bytes -> Word) - -> ProtocolSizeLimits (TxSubmission2 txid tx) bytes -byteLimitsTxSubmission2 = byteLimitsHello . byteLimitsTxSubmission - - --- | Time limits. --- --- Preserves the timeouts of 'TxSubmission' protocol, see --- 'timeLimitsTxSubmission'. 'MsgHello' does not have a timeout. --- -timeLimitsTxSubmission2 :: forall txid tx. ProtocolTimeLimits (TxSubmission2 txid tx) -timeLimitsTxSubmission2 = timeLimitsHello timeLimitsTxSubmission - - -codecTxSubmission2 - :: forall txid tx m. - ( MonadST m - , ShowProxy txid - , ShowProxy tx - ) - => (txid -> CBOR.Encoding) - -> (forall s . CBOR.Decoder s txid) - -> (tx -> CBOR.Encoding) - -> (forall s . CBOR.Decoder s tx) - -> Codec (TxSubmission2 txid tx) CBOR.DeserialiseFailure m ByteString -codecTxSubmission2 encodeTxId decodeTxId - encodeTx decodeTx = - codecHello - 6 - (encodeTxSubmission encodeTxId encodeTx) - (decodeTxSubmission decodeTxId decodeTx) - -codecTxSubmission2Id - :: forall txid tx m. Monad m - => Codec (TxSubmission2 txid tx) CodecFailure m (AnyMessage (TxSubmission2 txid tx)) -codecTxSubmission2Id = codecHelloId codecTxSubmissionId - diff --git a/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Type.hs b/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Type.hs deleted file mode 100644 index 2a40b0fd14e..00000000000 --- a/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/TxSubmission/Hello/Type.hs +++ /dev/null @@ -1,24 +0,0 @@ -{-# LANGUAGE DataKinds #-} - --- | The transaction submission protocol version 2. --- --- This module ony defines the type of the protocol, and exports all useful --- functions and types. --- -module Ouroboros.Network.Protocol.TxSubmission2.Hello.Type - ( TxSubmission2 - , module TxSubmission - , module Util - ) where - -import Ouroboros.Network.Protocol.Trans.Hello.Type (Hello) -import Ouroboros.Network.Protocol.Trans.Hello.Util as Util -import Ouroboros.Network.Protocol.TxSubmission.Type as TxSubmission - --- | The new version of transaction submission protocol. --- --- Unlike the original 'TxSubmission' protocol, this protocol starts with --- agency on the client side, like all other mini-protocols. --- -type TxSubmission2 txid tx = Hello (TxSubmission txid tx) StIdle -