Skip to content

Commit

Permalink
Rename inEraFeature to eraInEon
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Sep 20, 2023
1 parent ee9dc87 commit 1abb6d1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions cardano-api/internal/Cardano/Api/Certificate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ instance EraCast Certificate where
case cert of
ShelleyRelatedCertificate sourceWit sourceLedgerCert ->
shelleyToBabbageEraConstraints sourceWit
$ inEraFeature targetEra
( inEraFeature targetEra
$ eraInEon targetEra
( eraInEon targetEra
( Left $ EraCastError
{ originalValue = cert
, fromEra = shelleyToBabbageEraToCardanoEra sourceWit
Expand Down Expand Up @@ -299,8 +299,8 @@ instance EraCast Certificate where

ConwayCertificate sourceWit sourceLedgerCert ->
conwayEraOnwardsConstraints sourceWit
$ inEraFeature targetEra
( inEraFeature targetEra
$ eraInEon targetEra
( eraInEon targetEra
( Left $ EraCastError
{ originalValue = cert
, fromEra = conwayEraOnwardsToCardanoEra sourceWit
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Convenience/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ queryStateForBalancedTx era allTxIns certs = runExceptT $ do
& onLeft (left . QueryEraMismatch)

drepDelegDeposits <-
inEraFeature @ConwayEraOnwards era (pure mempty) $ \_ ->
eraInEon @ConwayEraOnwards era (pure mempty) $ \_ ->
Map.map (fromShelleyLovelace . drepDeposit) <$>
(lift (queryDRepState qeInMode sbe drepCreds)
& onLeft (left . QceUnsupportedNtcVersion)
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/internal/Cardano/Api/Eras.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Cardano.Api.Eras

-- * IsEon
, Eon(..)
, inEraFeature
, eraInEon
, inEraFeatureMaybe
, maybeFeatureInEra

Expand Down
8 changes: 4 additions & 4 deletions cardano-api/internal/Cardano/Api/Eras/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Cardano.Api.Eras.Core

-- * IsEon
, Eon(..)
, inEraFeature
, eraInEon
, inEraFeatureMaybe
, maybeFeatureInEra
, featureInShelleyBasedEra
Expand Down Expand Up @@ -143,13 +143,13 @@ class Eon (eon :: Type -> Type) where
-> CardanoEra era -- ^ Era to check
-> a -- ^ The value to use

inEraFeature :: ()
eraInEon :: ()
=> Eon eon
=> CardanoEra era -- ^ Era to check
-> a -- ^ Value to use if the eon does not include the era
-> (eon era -> a) -- ^ Function to get the value to use if the eon includes the era
-> a -- ^ The value to use
inEraFeature era no yes =
eraInEon era no yes =
inEonEra no yes era

inEraFeatureMaybe :: ()
Expand All @@ -158,7 +158,7 @@ inEraFeatureMaybe :: ()
-> (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 =
inEraFeature era Nothing (Just . yes)
eraInEon era Nothing (Just . yes)

maybeFeatureInEra :: ()
=> Eon eon
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module Cardano.Api (

-- * Feature support
Eon(..),
inEraFeature,
eraInEon,
inEraFeatureMaybe,
maybeFeatureInEra,

Expand Down

0 comments on commit 1abb6d1

Please sign in to comment.