diff --git a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs index 11b4fc71e6..46501e1aea 100644 --- a/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs +++ b/cardano-cli/src/Cardano/CLI/EraBased/Options/Governance/Actions.hs @@ -210,10 +210,10 @@ pUpdateProtocolParametersCmd = -- | Cost models only makes sense in eras from Alonzo onwards. For earlier -- eras, this parser doesn't show up in the command line and returns 'Nothing'. pCostModelsFile :: ShelleyBasedEra era -> Parser (Maybe (Cmd.CostModelsFile era)) -pCostModelsFile = - caseShelleyToMaryOrAlonzoEraOnwards - (const $ pure Nothing) - (\alonzoOnwards -> fmap (fmap $ Cmd.CostModelsFile alonzoOnwards . File) . optional $ pCostModels (Just "new")) +pCostModelsFile sbe = + forEraInEon sbe (pure Nothing) $ \alonzoOnwards -> do + file <- optional $ pCostModels (Just "new") + pure $ Cmd.CostModelsFile alonzoOnwards . File <$> file pGovernanceActionProtocolParametersUpdateCmd :: () => CardanoEra era