1
- {-# LANGUAGE ConstraintKinds #-}
2
1
{-# LANGUAGE CPP #-}
2
+ {-# LANGUAGE ConstraintKinds #-}
3
3
{-# LANGUAGE DataKinds #-}
4
4
{-# LANGUAGE FlexibleContexts #-}
5
5
{-# LANGUAGE FlexibleInstances #-}
@@ -25,8 +25,8 @@ module Cardano.Benchmarking.GeneratorTx.SubmissionClient
25
25
, txSubmissionClient
26
26
) where
27
27
28
- import Prelude (error ,fail )
29
28
import Cardano.Prelude hiding (ByteString , atomically , retry , state , threadDelay )
29
+ import Prelude (error , fail )
30
30
31
31
import Control.Arrow ((&&&) )
32
32
@@ -44,17 +44,16 @@ import Cardano.Tracing.OrphanInstances.Shelley ()
44
44
import qualified Ouroboros.Consensus.Cardano as Consensus (CardanoBlock )
45
45
import Ouroboros.Consensus.Ledger.SupportsMempool (GenTx , GenTxId , txInBlockSize )
46
46
import qualified Ouroboros.Consensus.Ledger.SupportsMempool as Mempool
47
- import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Mempool (TxId (ShelleyTxId ))
48
47
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto )
48
+ import qualified Ouroboros.Consensus.Shelley.Ledger.Mempool as Mempool (TxId (ShelleyTxId ))
49
49
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 ))
51
52
52
53
import Ouroboros.Network.Protocol.TxSubmission2.Client (ClientStIdle (.. ),
53
- ClientStTxIds (.. ),
54
- ClientStTxs (.. ),
55
- TxSubmissionClient (.. ))
54
+ ClientStTxIds (.. ), ClientStTxs (.. ), TxSubmissionClient (.. ))
56
55
import Ouroboros.Network.Protocol.TxSubmission2.Type (BlockingReplyList (.. ),
57
- TokBlockingStyle (.. ), TxSizeInBytes )
56
+ TokBlockingStyle (.. ), TxSizeInBytes )
58
57
59
58
import Cardano.Api hiding (Active )
60
59
import Cardano.Api.Shelley (fromShelleyTxId , toConsensusGenTx )
@@ -187,13 +186,8 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =
187
186
txToIdSize = (Mempool. txId &&& txInBlockSize) . toGenTx
188
187
189
188
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
+
197
191
198
192
fromGenTxId :: GenTxId CardanoBlock -> TxId
199
193
fromGenTxId (Block. GenTxIdShelley (Mempool. ShelleyTxId i)) = fromShelleyTxId i
0 commit comments