module Ouroboros.Network.Protocol.TxSubmission2.Codec.CDDL where

import Codec.CBOR.Read qualified as CBOR
import Codec.Serialise.Class qualified as Serialise
import Data.ByteString.Lazy qualified as BL
import Network.TypedProtocol.Codec
import Ouroboros.Network.Protocol.TxSubmission2.Codec
import Ouroboros.Network.Protocol.TxSubmission2.Test (Tx, TxId)
import Ouroboros.Network.Protocol.TxSubmission2.Type

txSubmissionCodec2 :: Codec (TxSubmission2 TxId Tx)
                            CBOR.DeserialiseFailure IO BL.ByteString
txSubmissionCodec2 :: Codec (TxSubmission2 TxId Tx) DeserialiseFailure IO ByteString
txSubmissionCodec2 =
    (TxId -> Encoding)
-> (forall s. Decoder s TxId)
-> (Tx -> Encoding)
-> (forall s. Decoder s Tx)
-> Codec (TxSubmission2 TxId Tx) DeserialiseFailure IO ByteString
forall txid tx (m :: * -> *).
MonadST m =>
(txid -> Encoding)
-> (forall s. Decoder s txid)
-> (tx -> Encoding)
-> (forall s. Decoder s tx)
-> Codec (TxSubmission2 txid tx) DeserialiseFailure m ByteString
codecTxSubmission2
      TxId -> Encoding
forall a. Serialise a => a -> Encoding
Serialise.encode
      Decoder s TxId
forall s. Decoder s TxId
forall a s. Serialise a => Decoder s a
Serialise.decode
      Tx -> Encoding
forall a. Serialise a => a -> Encoding
Serialise.encode
      Decoder s Tx
forall s. Decoder s Tx
forall a s. Serialise a => Decoder s a
Serialise.decode