Skip to content

Commit

Permalink
Delete CardanoEraStyle and cardanoEraStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Oct 28, 2023
1 parent db42dc1 commit 3edfb23
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
38 changes: 0 additions & 38 deletions cardano-api/internal/Cardano/Api/Eon/ShelleyBasedEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ module Cardano.Api.Eon.ShelleyBasedEra
, forShelleyBasedEraInEonMaybe
, forShelleyBasedEraMaybeEon

-- * Cardano eras, as Byron vs Shelley-based
, CardanoEraStyle(..)
, cardanoEraStyle

-- * Assertions on era
, requireShelleyBasedEra

Expand Down Expand Up @@ -316,40 +312,6 @@ shelleyBasedToCardanoEra ShelleyBasedEraAlonzo = AlonzoEra
shelleyBasedToCardanoEra ShelleyBasedEraBabbage = BabbageEra
shelleyBasedToCardanoEra ShelleyBasedEraConway = ConwayEra

-- ----------------------------------------------------------------------------
-- Cardano eras factored as Byron vs Shelley-based
--

-- | This is the same essential information as 'CardanoEra' but instead of a
-- flat set of alternative eras, it is factored into the legcy Byron era and
-- the current Shelley-based eras.
--
-- This way of factoring the eras is useful because in many cases the
-- major differences are between the Byron and Shelley-based eras, and
-- the Shelley-based eras can often be treated uniformly.
--
data CardanoEraStyle era where
LegacyByronEra :: CardanoEraStyle ByronEra

ShelleyBasedEra
:: ShelleyBasedEra era
-> CardanoEraStyle era

deriving instance Eq (CardanoEraStyle era)
deriving instance Ord (CardanoEraStyle era)
deriving instance Show (CardanoEraStyle era)

-- | The 'CardanoEraStyle' for a 'CardanoEra'.
--
cardanoEraStyle :: CardanoEra era -> CardanoEraStyle era
cardanoEraStyle ByronEra = LegacyByronEra
cardanoEraStyle ShelleyEra = ShelleyBasedEra ShelleyBasedEraShelley
cardanoEraStyle AllegraEra = ShelleyBasedEra ShelleyBasedEraAllegra
cardanoEraStyle MaryEra = ShelleyBasedEra ShelleyBasedEraMary
cardanoEraStyle AlonzoEra = ShelleyBasedEra ShelleyBasedEraAlonzo
cardanoEraStyle BabbageEra = ShelleyBasedEra ShelleyBasedEraBabbage
cardanoEraStyle ConwayEra = ShelleyBasedEra ShelleyBasedEraConway

-- ----------------------------------------------------------------------------
-- Conversion to Shelley ledger library types
--
Expand Down
2 changes: 0 additions & 2 deletions cardano-api/src/Cardano/Api.hs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ module Cardano.Api (
anyShelleyBasedEra,
InAnyShelleyBasedEra(..),
inAnyShelleyBasedEra,
CardanoEraStyle(..),
cardanoEraStyle,
shelleyBasedToCardanoEra,
shelleyBasedEraConstraints,

Expand Down

0 comments on commit 3edfb23

Please sign in to comment.