Skip to content

Commit

Permalink
Rename Feature to Eon in eon related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Sep 19, 2023
1 parent df78f2e commit 412242a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
13 changes: 6 additions & 7 deletions cardano-api/internal/Cardano/Api/Eras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ module Cardano.Api.Eras
-- * IsEon
, Eon(..)
, inEraEon
, inEraFeatureMaybe
, maybeFeatureInEra

, featureInShelleyBasedEra
, inShelleyBasedEraFeature
, inShelleyBasedEraFeatureMaybe
, maybeFeatureInShelleyBasedEra
, inEraEonMaybe
, maybeEonInEra
, eonInShelleyBasedEra
, inShelleyBasedEraEon
, inShelleyBasedEraEonMaybe
, maybeEonInShelleyBasedEra

-- * Shelley-based eras
, ShelleyBasedEra(..)
Expand Down
44 changes: 22 additions & 22 deletions cardano-api/internal/Cardano/Api/Eras/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ module Cardano.Api.Eras.Core
-- * IsEon
, Eon(..)
, inEraEon
, inEraFeatureMaybe
, maybeFeatureInEra
, featureInShelleyBasedEra
, inShelleyBasedEraFeature
, inShelleyBasedEraFeatureMaybe
, maybeFeatureInShelleyBasedEra
, inEraEonMaybe
, maybeEonInEra
, eonInShelleyBasedEra
, inShelleyBasedEraEon
, inShelleyBasedEraEonMaybe
, maybeEonInShelleyBasedEra

-- * Shelley-based eras
, ShelleyBasedEra(..)
Expand Down Expand Up @@ -152,54 +152,54 @@ inEraEon :: ()
inEraEon era no yes =
eonInEra 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 =
inEraEon 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 =
eonInEra 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 =
eonInEra no yes . shelleyBasedToCardanoEra

maybeFeatureInShelleyBasedEra :: ()
maybeEonInShelleyBasedEra :: ()
=> Eon eon
=> ShelleyBasedEra era
-> Maybe (eon era)
maybeFeatureInShelleyBasedEra =
maybeEonInShelleyBasedEra =
eonInEra 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
Expand Down
4 changes: 2 additions & 2 deletions cardano-api/internal/Cardano/Api/TxBody.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ module Cardano.Api (
-- * Feature support
Eon(..),
inEraEon,
inEraFeatureMaybe,
maybeFeatureInEra,
inEraEonMaybe,
maybeEonInEra,

featureInShelleyBasedEra,
inShelleyBasedEraFeature,
inShelleyBasedEraFeatureMaybe,
maybeFeatureInShelleyBasedEra,
eonInShelleyBasedEra,
inShelleyBasedEraEon,
inShelleyBasedEraEonMaybe,
maybeEonInShelleyBasedEra,

Featured(..),
asFeaturedInEra,
Expand Down

0 comments on commit 412242a

Please sign in to comment.