Skip to content

Commit b5f315d

Browse files
committed
tx-generator: Core.hs: simplify queryRemoteProtocolParameters
1 parent 9017d91 commit b5f315d

File tree

1 file changed

+5
-9
lines changed
  • bench/tx-generator/src/Cardano/Benchmarking/Script

1 file changed

+5
-9
lines changed

bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ queryRemoteProtocolParameters :: ActionM ProtocolParameters
174174
queryRemoteProtocolParameters = do
175175
localNodeConnectInfo <- getLocalConnectInfo
176176
chainTip <- liftIO $ getLocalChainTip localNodeConnectInfo
177-
era <- queryEra
177+
AnyCardanoEra era <- queryEra
178178
let
179179
callQuery :: forall era.
180180
QueryInEra era (Ledger.PParams (ShelleyLedgerEra era))
@@ -187,14 +187,10 @@ queryRemoteProtocolParameters = do
187187
liftIO $ BSL.writeFile pparamsFile $ prettyPrintOrdered pp'
188188
traceDebug $ "queryRemoteProtocolParameters : query result saved in: " ++ pparamsFile
189189
return pp'
190-
case era of
191-
AnyCardanoEra ByronEra -> liftTxGenError $ TxGenError "queryRemoteProtocolParameters Byron not supported"
192-
AnyCardanoEra ShelleyEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraShelley QueryProtocolParameters
193-
AnyCardanoEra AllegraEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraAllegra QueryProtocolParameters
194-
AnyCardanoEra MaryEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraMary QueryProtocolParameters
195-
AnyCardanoEra AlonzoEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraAlonzo QueryProtocolParameters
196-
AnyCardanoEra BabbageEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraBabbage QueryProtocolParameters
197-
AnyCardanoEra ConwayEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraConway QueryProtocolParameters
190+
caseByronOrShelleyBasedEra
191+
(liftTxGenError $ TxGenError "queryRemoteProtocolParameters Byron not supported")
192+
(\sbe -> callQuery $ QueryInShelleyBasedEra sbe QueryProtocolParameters)
193+
era
198194

199195
getProtocolParameters :: ActionM ProtocolParameters
200196
getProtocolParameters = do

0 commit comments

Comments
 (0)