diff --git a/cardano-api/internal/Cardano/Api/Eras.hs b/cardano-api/internal/Cardano/Api/Eras.hs index 0389861401..93288f6ae9 100644 --- a/cardano-api/internal/Cardano/Api/Eras.hs +++ b/cardano-api/internal/Cardano/Api/Eras.hs @@ -23,13 +23,12 @@ module Cardano.Api.Eras -- * IsEon , Eon(..) , eraInEon - , inEraFeatureMaybe - , maybeFeatureInEra - - , featureInShelleyBasedEra - , inShelleyBasedEraFeature - , inShelleyBasedEraFeatureMaybe - , maybeFeatureInShelleyBasedEra + , inEraEonMaybe + , maybeEonInEra + , eonInShelleyBasedEra + , inShelleyBasedEraEon + , inShelleyBasedEraEonMaybe + , maybeEonInShelleyBasedEra -- * Shelley-based eras , ShelleyBasedEra(..) diff --git a/cardano-api/internal/Cardano/Api/Eras/Core.hs b/cardano-api/internal/Cardano/Api/Eras/Core.hs index 673bcd1ff0..68e5d10458 100644 --- a/cardano-api/internal/Cardano/Api/Eras/Core.hs +++ b/cardano-api/internal/Cardano/Api/Eras/Core.hs @@ -32,12 +32,12 @@ module Cardano.Api.Eras.Core -- * IsEon , Eon(..) , eraInEon - , inEraFeatureMaybe - , maybeFeatureInEra - , featureInShelleyBasedEra - , inShelleyBasedEraFeature - , inShelleyBasedEraFeatureMaybe - , maybeFeatureInShelleyBasedEra + , inEraEonMaybe + , maybeEonInEra + , eonInShelleyBasedEra + , inShelleyBasedEraEon + , inShelleyBasedEraEonMaybe + , maybeEonInShelleyBasedEra -- * Shelley-based eras , ShelleyBasedEra(..) @@ -152,54 +152,54 @@ eraInEon :: () eraInEon era no yes = inEonEra no yes era -inEraFeatureMaybe :: () +inEraEonMaybe :: () => Eon eon => CardanoEra era -- ^ Era to check -> (eon era -> a) -- ^ Function to get the value to use if the eon includes the era -> Maybe a -- ^ The value to use -inEraFeatureMaybe era yes = +inEraEonMaybe era yes = eraInEon era Nothing (Just . yes) -maybeFeatureInEra :: () +maybeEonInEra :: () => Eon eon => CardanoEra era -- ^ Era to check - -> Maybe (eon era) -- ^ The feature if supported in the era -maybeFeatureInEra = + -> Maybe (eon era) -- ^ The eon if supported in the era +maybeEonInEra = inEonEra Nothing Just --- | Determine the value to use for a feature in a given 'ShelleyBasedEra'. -featureInShelleyBasedEra :: () +-- | Determine the value to use for a eon in a given 'ShelleyBasedEra'. +eonInShelleyBasedEra :: () => Eon eon => a -> (eon era -> a) -> ShelleyBasedEra era -> a -featureInShelleyBasedEra no yes = +eonInShelleyBasedEra no yes = inEonEra no yes . shelleyBasedToCardanoEra -maybeFeatureInShelleyBasedEra :: () +maybeEonInShelleyBasedEra :: () => Eon eon => ShelleyBasedEra era -> Maybe (eon era) -maybeFeatureInShelleyBasedEra = +maybeEonInShelleyBasedEra = inEonEra Nothing Just . shelleyBasedToCardanoEra -inShelleyBasedEraFeature :: () +inShelleyBasedEraEon :: () => Eon eon => ShelleyBasedEra era -> a -> (eon era -> a) -> a -inShelleyBasedEraFeature era no yes = - featureInShelleyBasedEra no yes era +inShelleyBasedEraEon era no yes = + eonInShelleyBasedEra no yes era -inShelleyBasedEraFeatureMaybe :: () +inShelleyBasedEraEonMaybe :: () => Eon eon => ShelleyBasedEra era -> (eon era -> a) -> Maybe a -inShelleyBasedEraFeatureMaybe era yes = - inShelleyBasedEraFeature era Nothing (Just . yes) +inShelleyBasedEraEonMaybe era yes = + inShelleyBasedEraEon era Nothing (Just . yes) -- ---------------------------------------------------------------------------- -- ToCardanoEra diff --git a/cardano-api/internal/Cardano/Api/TxBody.hs b/cardano-api/internal/Cardano/Api/TxBody.hs index be22a41574..955eb45cb2 100644 --- a/cardano-api/internal/Cardano/Api/TxBody.hs +++ b/cardano-api/internal/Cardano/Api/TxBody.hs @@ -2722,7 +2722,7 @@ fromLedgerProposalProcedures -> Ledger.TxBody (ShelleyLedgerEra era) -> Maybe (Featured ConwayEraOnwards era [Proposal era]) fromLedgerProposalProcedures sbe body = - inShelleyBasedEraFeatureMaybe sbe $ \w -> + inShelleyBasedEraEonMaybe sbe $ \w -> conwayEraOnwardsConstraints w $ Featured w $ fmap Proposal @@ -2734,7 +2734,7 @@ fromLedgerVotingProcedures :: () -> Ledger.TxBody (ShelleyLedgerEra era) -> Maybe (Featured ConwayEraOnwards era (VotingProcedures era)) fromLedgerVotingProcedures sbe body = - inShelleyBasedEraFeatureMaybe sbe $ \w -> + inShelleyBasedEraEonMaybe sbe $ \w -> conwayEraOnwardsConstraints w $ Featured w $ VotingProcedures diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index 9a69797c34..03549c2536 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -30,13 +30,13 @@ module Cardano.Api ( -- * Feature support Eon(..), eraInEon, - inEraFeatureMaybe, - maybeFeatureInEra, + inEraEonMaybe, + maybeEonInEra, - featureInShelleyBasedEra, - inShelleyBasedEraFeature, - inShelleyBasedEraFeatureMaybe, - maybeFeatureInShelleyBasedEra, + eonInShelleyBasedEra, + inShelleyBasedEraEon, + inShelleyBasedEraEonMaybe, + maybeEonInShelleyBasedEra, Featured(..), asFeaturedInEra,