diff --git a/cardano-api/internal/Cardano/Api/Certificate.hs b/cardano-api/internal/Cardano/Api/Certificate.hs index 14516b35c3..5ba5cbd09a 100644 --- a/cardano-api/internal/Cardano/Api/Certificate.hs +++ b/cardano-api/internal/Cardano/Api/Certificate.hs @@ -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 @@ -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 diff --git a/cardano-api/internal/Cardano/Api/Convenience/Query.hs b/cardano-api/internal/Cardano/Api/Convenience/Query.hs index f81d613e69..e2bc9c63fa 100644 --- a/cardano-api/internal/Cardano/Api/Convenience/Query.hs +++ b/cardano-api/internal/Cardano/Api/Convenience/Query.hs @@ -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) diff --git a/cardano-api/internal/Cardano/Api/Eras.hs b/cardano-api/internal/Cardano/Api/Eras.hs index 87110ec11c..0389861401 100644 --- a/cardano-api/internal/Cardano/Api/Eras.hs +++ b/cardano-api/internal/Cardano/Api/Eras.hs @@ -22,7 +22,7 @@ module Cardano.Api.Eras -- * IsEon , Eon(..) - , inEraFeature + , eraInEon , inEraFeatureMaybe , maybeFeatureInEra diff --git a/cardano-api/internal/Cardano/Api/Eras/Core.hs b/cardano-api/internal/Cardano/Api/Eras/Core.hs index 397e350e54..673bcd1ff0 100644 --- a/cardano-api/internal/Cardano/Api/Eras/Core.hs +++ b/cardano-api/internal/Cardano/Api/Eras/Core.hs @@ -31,7 +31,7 @@ module Cardano.Api.Eras.Core -- * IsEon , Eon(..) - , inEraFeature + , eraInEon , inEraFeatureMaybe , maybeFeatureInEra , featureInShelleyBasedEra @@ -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 :: () @@ -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 diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index 382d7c97f7..9a69797c34 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -29,7 +29,7 @@ module Cardano.Api ( -- * Feature support Eon(..), - inEraFeature, + eraInEon, inEraFeatureMaybe, maybeFeatureInEra,