Skip to content

Commit

Permalink
Merge pull request #131 from input-output-hk/newhoggy/new-FeatureInEr…
Browse files Browse the repository at this point in the history
…a-instance-for-ShelleyBasedEra

`FeatureInEra` instance for `ShelleyBasedEra`
  • Loading branch information
newhoggy committed Jul 24, 2023
2 parents 64bf8c6 + 35b0da0 commit 2f9349a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cardano-api/internal/Cardano/Api/Feature.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class FeatureInEra (feature :: Type -> Type) where
-> CardanoEra era -- ^ Era to check
-> a -- ^ The value to use

instance FeatureInEra ShelleyBasedEra where
featureInEra no yes = \case
ByronEra -> no
ShelleyEra -> yes ShelleyBasedEraShelley
AllegraEra -> yes ShelleyBasedEraAllegra
MaryEra -> yes ShelleyBasedEraMary
AlonzoEra -> yes ShelleyBasedEraAlonzo
BabbageEra -> yes ShelleyBasedEraBabbage
ConwayEra -> yes ShelleyBasedEraConway

-- | Determine the value to use for a feature in a given 'ShelleyBasedEra'.
featureInShelleyBasedEra :: ()
=> FeatureInEra feature
Expand Down

0 comments on commit 2f9349a

Please sign in to comment.