Skip to content

Commit

Permalink
FeatureInEra instance for ShelleyBasedEra
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Jul 23, 2023
1 parent 64bf8c6 commit 35b0da0
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 35b0da0

Please sign in to comment.