Skip to content

Commit

Permalink
Merge pull request #256 from input-output-hk/newhoggy/delete-unused-c…
Browse files Browse the repository at this point in the history
…onstraints

Delete unused eon constraints
  • Loading branch information
newhoggy authored Sep 22, 2023
2 parents 340725a + 44152a9 commit 6ef9f28
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 121 deletions.
8 changes: 0 additions & 8 deletions cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnly.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.AlonzoEraOnly
( AlonzoEraOnly(..)
, IsAlonzoEraOnly(..)
, AnyAlonzoEraOnly(..)
, alonzoEraOnlyConstraints
, alonzoEraOnlyToCardanoEra
Expand Down Expand Up @@ -39,18 +38,12 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsAlonzoEraOnly era where
alonzoEraOnly :: AlonzoEraOnly era

data AlonzoEraOnly era where
AlonzoEraOnlyAlonzo :: AlonzoEraOnly AlonzoEra

deriving instance Show (AlonzoEraOnly era)
deriving instance Eq (AlonzoEraOnly era)

instance IsAlonzoEraOnly AlonzoEra where
alonzoEraOnly = AlonzoEraOnlyAlonzo

instance Eon AlonzoEraOnly where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -96,7 +89,6 @@ type AlonzoEraOnlyConstraints era =

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsAlonzoEraOnly era
, IsCardanoEra era
, IsShelleyBasedEra era
, ToJSON (DebugLedgerState era)
Expand Down
14 changes: 0 additions & 14 deletions cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.AlonzoEraOnwards
( AlonzoEraOnwards(..)
, IsAlonzoEraOnwards(..)
, AnyAlonzoEraOnwards(..)
, alonzoEraOnwardsConstraints
, alonzoEraOnwardsToCardanoEra
Expand Down Expand Up @@ -39,9 +38,6 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsAlonzoEraOnwards era where
alonzoEraOnwards :: AlonzoEraOnwards era

data AlonzoEraOnwards era where
AlonzoEraOnwardsAlonzo :: AlonzoEraOnwards AlonzoEra
AlonzoEraOnwardsBabbage :: AlonzoEraOnwards BabbageEra
Expand All @@ -50,15 +46,6 @@ data AlonzoEraOnwards era where
deriving instance Show (AlonzoEraOnwards era)
deriving instance Eq (AlonzoEraOnwards era)

instance IsAlonzoEraOnwards AlonzoEra where
alonzoEraOnwards = AlonzoEraOnwardsAlonzo

instance IsAlonzoEraOnwards BabbageEra where
alonzoEraOnwards = AlonzoEraOnwardsBabbage

instance IsAlonzoEraOnwards ConwayEra where
alonzoEraOnwards = AlonzoEraOnwardsConway

instance Eon AlonzoEraOnwards where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -103,7 +90,6 @@ type AlonzoEraOnwardsConstraints era =

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsAlonzoEraOnwards era
, IsCardanoEra era
, IsShelleyBasedEra era
, ToJSON (DebugLedgerState era)
Expand Down
11 changes: 0 additions & 11 deletions cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.BabbageEraOnwards
( BabbageEraOnwards(..)
, IsBabbageEraOnwards(..)
, AnyBabbageEraOnwards(..)
, babbageEraOnwardsConstraints
, babbageEraOnwardsToCardanoEra
Expand Down Expand Up @@ -39,22 +38,13 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsBabbageEraOnwards era where
babbageEraOnwards :: BabbageEraOnwards era

data BabbageEraOnwards era where
BabbageEraOnwardsBabbage :: BabbageEraOnwards BabbageEra
BabbageEraOnwardsConway :: BabbageEraOnwards ConwayEra

deriving instance Show (BabbageEraOnwards era)
deriving instance Eq (BabbageEraOnwards era)

instance IsBabbageEraOnwards BabbageEra where
babbageEraOnwards = BabbageEraOnwardsBabbage

instance IsBabbageEraOnwards ConwayEra where
babbageEraOnwards = BabbageEraOnwardsConway

instance Eon BabbageEraOnwards where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -96,7 +86,6 @@ type BabbageEraOnwardsConstraints era =

, FromCBOR (Consensus.ChainDepState (ConsensusProtocol era))
, FromCBOR (DebugLedgerState era)
, IsBabbageEraOnwards era
, IsCardanoEra era
, IsShelleyBasedEra era
, ToJSON (DebugLedgerState era)
Expand Down
10 changes: 1 addition & 9 deletions cardano-api/internal/Cardano/Api/Eon/ByronEraOnly.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

module Cardano.Api.Eon.ByronEraOnly
( ByronEraOnly(..)
, IsByronEraOnly(..)
, AnyByronEraOnly(..)
, byronEraOnlyConstraints
, byronEraOnlyToCardanoEra
Expand All @@ -20,18 +19,12 @@ import Cardano.Api.Eras.Core

import Data.Typeable (Typeable)

class IsByronEraOnly era where
byronEraOnly :: ByronEraOnly era

data ByronEraOnly era where
ByronEraOnlyByron :: ByronEraOnly ByronEra

deriving instance Show (ByronEraOnly era)
deriving instance Eq (ByronEraOnly era)

instance IsByronEraOnly ByronEra where
byronEraOnly = ByronEraOnlyByron

instance Eon ByronEraOnly where
inEonForEra no yes = \case
ByronEra -> yes ByronEraOnlyByron
Expand All @@ -52,8 +45,7 @@ data AnyByronEraOnly where
deriving instance Show AnyByronEraOnly

type ByronEraOnlyConstraints era =
( IsByronEraOnly era
, IsCardanoEra era
( IsCardanoEra era
, Typeable era
)

Expand Down
8 changes: 0 additions & 8 deletions cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.ConwayEraOnwards
( ConwayEraOnwards(..)
, IsConwayEraOnwards(..)
, AnyConwayEraOnwards(..)
, conwayEraOnwardsConstraints
, conwayEraOnwardsToCardanoEra
Expand Down Expand Up @@ -41,18 +40,12 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsConwayEraOnwards era where
conwayEraOnwards :: ConwayEraOnwards era

data ConwayEraOnwards era where
ConwayEraOnwardsConway :: ConwayEraOnwards ConwayEra

deriving instance Show (ConwayEraOnwards era)
deriving instance Eq (ConwayEraOnwards era)

instance IsConwayEraOnwards ConwayEra where
conwayEraOnwards = ConwayEraOnwardsConway

instance Eon ConwayEraOnwards where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -98,7 +91,6 @@ type ConwayEraOnwardsConstraints era =
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
, IsShelleyBasedEra era
, IsConwayEraOnwards era
, ToJSON (DebugLedgerState era)
, Typeable era
)
Expand Down
11 changes: 0 additions & 11 deletions cardano-api/internal/Cardano/Api/Eon/ShelleyToAllegraEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.ShelleyToAllegraEra
( ShelleyToAllegraEra(..)
, IsShelleyToAllegraEra(..)
, AnyShelleyToAllegraEra(..)
, shelleyToAllegraEraConstraints
, shelleyToAllegraEraToCardanoEra
Expand Down Expand Up @@ -40,22 +39,13 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsShelleyToAllegraEra era where
shelleyToAllegraEra :: ShelleyToAllegraEra era

data ShelleyToAllegraEra era where
ShelleyToAllegraEraShelley :: ShelleyToAllegraEra ShelleyEra
ShelleyToAllegraEraAllegra :: ShelleyToAllegraEra AllegraEra

deriving instance Show (ShelleyToAllegraEra era)
deriving instance Eq (ShelleyToAllegraEra era)

instance IsShelleyToAllegraEra ShelleyEra where
shelleyToAllegraEra = ShelleyToAllegraEraShelley

instance IsShelleyToAllegraEra AllegraEra where
shelleyToAllegraEra = ShelleyToAllegraEraAllegra

instance Eon ShelleyToAllegraEra where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -95,7 +85,6 @@ type ShelleyToAllegraEraConstraints era =
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
, IsShelleyBasedEra era
, IsShelleyToAllegraEra era
, ToJSON (DebugLedgerState era)
, Typeable era
)
Expand Down
17 changes: 0 additions & 17 deletions cardano-api/internal/Cardano/Api/Eon/ShelleyToAlonzoEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.ShelleyToAlonzoEra
( ShelleyToAlonzoEra(..)
, IsShelleyToAlonzoEra(..)
, AnyShelleyToAlonzoEra(..)
, shelleyToAlonzoEraConstraints
, shelleyToAlonzoEraToCardanoEra
Expand Down Expand Up @@ -40,9 +39,6 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsShelleyToAlonzoEra era where
shelleyToAlonzoEra :: ShelleyToAlonzoEra era

data ShelleyToAlonzoEra era where
ShelleyToAlonzoEraShelley :: ShelleyToAlonzoEra ShelleyEra
ShelleyToAlonzoEraAllegra :: ShelleyToAlonzoEra AllegraEra
Expand All @@ -52,18 +48,6 @@ data ShelleyToAlonzoEra era where
deriving instance Show (ShelleyToAlonzoEra era)
deriving instance Eq (ShelleyToAlonzoEra era)

instance IsShelleyToAlonzoEra ShelleyEra where
shelleyToAlonzoEra = ShelleyToAlonzoEraShelley

instance IsShelleyToAlonzoEra AllegraEra where
shelleyToAlonzoEra = ShelleyToAlonzoEraAllegra

instance IsShelleyToAlonzoEra MaryEra where
shelleyToAlonzoEra = ShelleyToAlonzoEraMary

instance IsShelleyToAlonzoEra AlonzoEra where
shelleyToAlonzoEra = ShelleyToAlonzoEraAlonzo

instance Eon ShelleyToAlonzoEra where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -104,7 +88,6 @@ type ShelleyToAlonzoEraConstraints era =
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
, IsShelleyBasedEra era
, IsShelleyToAlonzoEra era
, ToJSON (DebugLedgerState era)
, Typeable era
)
Expand Down
20 changes: 0 additions & 20 deletions cardano-api/internal/Cardano/Api/Eon/ShelleyToBabbageEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.ShelleyToBabbageEra
( ShelleyToBabbageEra(..)
, IsShelleyToBabbageEra(..)
, AnyShelleyToBabbageEra(..)
, shelleyToBabbageEraConstraints
, shelleyToBabbageEraToCardanoEra
Expand Down Expand Up @@ -40,9 +39,6 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsShelleyToBabbageEra era where
shelleyToBabbageEra :: ShelleyToBabbageEra era

data ShelleyToBabbageEra era where
ShelleyToBabbageEraShelley :: ShelleyToBabbageEra ShelleyEra
ShelleyToBabbageEraAllegra :: ShelleyToBabbageEra AllegraEra
Expand All @@ -53,21 +49,6 @@ data ShelleyToBabbageEra era where
deriving instance Show (ShelleyToBabbageEra era)
deriving instance Eq (ShelleyToBabbageEra era)

instance IsShelleyToBabbageEra ShelleyEra where
shelleyToBabbageEra = ShelleyToBabbageEraShelley

instance IsShelleyToBabbageEra AllegraEra where
shelleyToBabbageEra = ShelleyToBabbageEraAllegra

instance IsShelleyToBabbageEra MaryEra where
shelleyToBabbageEra = ShelleyToBabbageEraMary

instance IsShelleyToBabbageEra AlonzoEra where
shelleyToBabbageEra = ShelleyToBabbageEraAlonzo

instance IsShelleyToBabbageEra BabbageEra where
shelleyToBabbageEra = ShelleyToBabbageEraBabbage

instance Eon ShelleyToBabbageEra where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -108,7 +89,6 @@ type ShelleyToBabbageEraConstraints era =
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
, IsShelleyBasedEra era
, IsShelleyToBabbageEra era
, ToJSON (DebugLedgerState era)
, Typeable era
)
Expand Down
14 changes: 0 additions & 14 deletions cardano-api/internal/Cardano/Api/Eon/ShelleyToMaryEra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

module Cardano.Api.Eon.ShelleyToMaryEra
( ShelleyToMaryEra(..)
, IsShelleyToMaryEra(..)
, AnyShelleyToMaryEra(..)
, shelleyToMaryEraConstraints
, shelleyToMaryEraToCardanoEra
Expand Down Expand Up @@ -40,9 +39,6 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus
import Data.Aeson
import Data.Typeable (Typeable)

class IsShelleyBasedEra era => IsShelleyToMaryEra era where
shelleyToMaryEra :: ShelleyToMaryEra era

data ShelleyToMaryEra era where
ShelleyToMaryEraShelley :: ShelleyToMaryEra ShelleyEra
ShelleyToMaryEraAllegra :: ShelleyToMaryEra AllegraEra
Expand All @@ -51,15 +47,6 @@ data ShelleyToMaryEra era where
deriving instance Show (ShelleyToMaryEra era)
deriving instance Eq (ShelleyToMaryEra era)

instance IsShelleyToMaryEra ShelleyEra where
shelleyToMaryEra = ShelleyToMaryEraShelley

instance IsShelleyToMaryEra AllegraEra where
shelleyToMaryEra = ShelleyToMaryEraAllegra

instance IsShelleyToMaryEra MaryEra where
shelleyToMaryEra = ShelleyToMaryEraMary

instance Eon ShelleyToMaryEra where
inEonForEra no yes = \case
ByronEra -> no
Expand Down Expand Up @@ -100,7 +87,6 @@ type ShelleyToMaryEraConstraints era =
, FromCBOR (DebugLedgerState era)
, IsCardanoEra era
, IsShelleyBasedEra era
, IsShelleyToMaryEra era
, ToJSON (DebugLedgerState era)
, Typeable era
)
Expand Down
Loading

0 comments on commit 6ef9f28

Please sign in to comment.