1- {-# LANGUAGE ConstraintKinds #-}
21{-# LANGUAGE CPP #-}
2+ {-# LANGUAGE ConstraintKinds #-}
33{-# LANGUAGE DataKinds #-}
44{-# LANGUAGE FlexibleContexts #-}
55{-# LANGUAGE FlexibleInstances #-}
@@ -25,8 +25,8 @@ module Cardano.Benchmarking.GeneratorTx.SubmissionClient
2525 , txSubmissionClient
2626 ) where
2727
28- import Prelude (error ,fail )
2928import Cardano.Prelude hiding (ByteString , atomically , retry , state , threadDelay )
29+ import Prelude (error , fail )
3030
3131import Control.Arrow ((&&&) )
3232
@@ -44,17 +44,16 @@ import Cardano.Tracing.OrphanInstances.Shelley ()
4444import qualified Ouroboros.Consensus.Cardano as Consensus (CardanoBlock )
4545import Ouroboros.Consensus.Ledger.SupportsMempool (GenTx , GenTxId , txInBlockSize )
4646import qualified Ouroboros.Consensus.Ledger.SupportsMempool as Mempool
47- import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Mempool (TxId (ShelleyTxId ))
4847import Ouroboros.Consensus.Shelley.Eras (StandardCrypto )
48+ import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Mempool (TxId (ShelleyTxId ))
4949
50- import qualified Ouroboros.Consensus.Cardano.Block as Block (TxId (GenTxIdShelley , GenTxIdAllegra , GenTxIdAlonzo , GenTxIdMary ,GenTxIdBabbage , GenTxIdConway ))
50+ import qualified Ouroboros.Consensus.Cardano.Block as Block
51+ (TxId (GenTxIdAllegra , GenTxIdAlonzo , GenTxIdBabbage , GenTxIdConway , GenTxIdMary , GenTxIdShelley ))
5152
5253import Ouroboros.Network.Protocol.TxSubmission2.Client (ClientStIdle (.. ),
53- ClientStTxIds (.. ),
54- ClientStTxs (.. ),
55- TxSubmissionClient (.. ))
54+ ClientStTxIds (.. ), ClientStTxs (.. ), TxSubmissionClient (.. ))
5655import Ouroboros.Network.Protocol.TxSubmission2.Type (BlockingReplyList (.. ),
57- TokBlockingStyle (.. ), TxSizeInBytes )
56+ TokBlockingStyle (.. ), TxSizeInBytes )
5857
5958import Cardano.Api hiding (Active )
6059import Cardano.Api.Shelley (fromShelleyTxId , toConsensusGenTx )
@@ -187,13 +186,8 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
187186 txToIdSize = (Mempool. txId &&& txInBlockSize) . toGenTx
188187
189188 toGenTx :: tx -> GenTx CardanoBlock
190- toGenTx tx = case shelleyBasedEra @ era of
191- ShelleyBasedEraShelley -> toConsensusGenTx $ TxInMode ShelleyEra tx
192- ShelleyBasedEraAllegra -> toConsensusGenTx $ TxInMode AllegraEra tx
193- ShelleyBasedEraMary -> toConsensusGenTx $ TxInMode MaryEra tx
194- ShelleyBasedEraAlonzo -> toConsensusGenTx $ TxInMode AlonzoEra tx
195- ShelleyBasedEraBabbage -> toConsensusGenTx $ TxInMode BabbageEra tx
196- ShelleyBasedEraConway -> toConsensusGenTx $ TxInMode ConwayEra tx
189+ toGenTx tx = toConsensusGenTx $ TxInMode (shelleyBasedEra @ era ) tx
190+
197191
198192 fromGenTxId :: GenTxId CardanoBlock -> TxId
199193 fromGenTxId (Block. GenTxIdShelley (Mempool. ShelleyTxId i)) = fromShelleyTxId i
0 commit comments