From 44152a9becd01f4ef246bec2ea466e0d2f64f018 Mon Sep 17 00:00:00 2001 From: John Ky Date: Fri, 22 Sep 2023 18:30:48 +1000 Subject: [PATCH] Delete unused eon constraints --- .../internal/Cardano/Api/Eon/AlonzoEraOnly.hs | 8 -------- .../Cardano/Api/Eon/AlonzoEraOnwards.hs | 14 ------------- .../Cardano/Api/Eon/BabbageEraOnwards.hs | 11 ---------- .../internal/Cardano/Api/Eon/ByronEraOnly.hs | 10 +--------- .../Cardano/Api/Eon/ConwayEraOnwards.hs | 8 -------- .../Cardano/Api/Eon/ShelleyToAllegraEra.hs | 11 ---------- .../Cardano/Api/Eon/ShelleyToAlonzoEra.hs | 17 ---------------- .../Cardano/Api/Eon/ShelleyToBabbageEra.hs | 20 ------------------- .../Cardano/Api/Eon/ShelleyToMaryEra.hs | 14 ------------- cardano-api/src/Cardano/Api.hs | 9 --------- 10 files changed, 1 insertion(+), 121 deletions(-) diff --git a/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnly.hs b/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnly.hs index 8cd6395c0d..5ec37581e7 100644 --- a/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnly.hs +++ b/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnly.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.AlonzoEraOnly ( AlonzoEraOnly(..) - , IsAlonzoEraOnly(..) , AnyAlonzoEraOnly(..) , alonzoEraOnlyConstraints , alonzoEraOnlyToCardanoEra @@ -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 @@ -96,7 +89,6 @@ type AlonzoEraOnlyConstraints era = , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) - , IsAlonzoEraOnly era , IsCardanoEra era , IsShelleyBasedEra era , ToJSON (DebugLedgerState era) diff --git a/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs b/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs index c72e492aec..1d8d86468a 100644 --- a/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs +++ b/cardano-api/internal/Cardano/Api/Eon/AlonzoEraOnwards.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.AlonzoEraOnwards ( AlonzoEraOnwards(..) - , IsAlonzoEraOnwards(..) , AnyAlonzoEraOnwards(..) , alonzoEraOnwardsConstraints , alonzoEraOnwardsToCardanoEra @@ -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 @@ -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 @@ -103,7 +90,6 @@ type AlonzoEraOnwardsConstraints era = , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) - , IsAlonzoEraOnwards era , IsCardanoEra era , IsShelleyBasedEra era , ToJSON (DebugLedgerState era) diff --git a/cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs b/cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs index 926c2385cd..3a8c867365 100644 --- a/cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs +++ b/cardano-api/internal/Cardano/Api/Eon/BabbageEraOnwards.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.BabbageEraOnwards ( BabbageEraOnwards(..) - , IsBabbageEraOnwards(..) , AnyBabbageEraOnwards(..) , babbageEraOnwardsConstraints , babbageEraOnwardsToCardanoEra @@ -39,9 +38,6 @@ 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 @@ -49,12 +45,6 @@ data BabbageEraOnwards era where 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 @@ -96,7 +86,6 @@ type BabbageEraOnwardsConstraints era = , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) - , IsBabbageEraOnwards era , IsCardanoEra era , IsShelleyBasedEra era , ToJSON (DebugLedgerState era) diff --git a/cardano-api/internal/Cardano/Api/Eon/ByronEraOnly.hs b/cardano-api/internal/Cardano/Api/Eon/ByronEraOnly.hs index 2e9a38b659..315ec5684f 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ByronEraOnly.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ByronEraOnly.hs @@ -8,7 +8,6 @@ module Cardano.Api.Eon.ByronEraOnly ( ByronEraOnly(..) - , IsByronEraOnly(..) , AnyByronEraOnly(..) , byronEraOnlyConstraints , byronEraOnlyToCardanoEra @@ -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 @@ -52,8 +45,7 @@ data AnyByronEraOnly where deriving instance Show AnyByronEraOnly type ByronEraOnlyConstraints era = - ( IsByronEraOnly era - , IsCardanoEra era + ( IsCardanoEra era , Typeable era ) diff --git a/cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs b/cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs index 857fd93267..c68061d343 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ConwayEraOnwards.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.ConwayEraOnwards ( ConwayEraOnwards(..) - , IsConwayEraOnwards(..) , AnyConwayEraOnwards(..) , conwayEraOnwardsConstraints , conwayEraOnwardsToCardanoEra @@ -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 @@ -98,7 +91,6 @@ type ConwayEraOnwardsConstraints era = , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era - , IsConwayEraOnwards era , ToJSON (DebugLedgerState era) , Typeable era ) diff --git a/cardano-api/internal/Cardano/Api/Eon/ShelleyToAllegraEra.hs b/cardano-api/internal/Cardano/Api/Eon/ShelleyToAllegraEra.hs index 8d909341f1..5274e282f3 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ShelleyToAllegraEra.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ShelleyToAllegraEra.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.ShelleyToAllegraEra ( ShelleyToAllegraEra(..) - , IsShelleyToAllegraEra(..) , AnyShelleyToAllegraEra(..) , shelleyToAllegraEraConstraints , shelleyToAllegraEraToCardanoEra @@ -40,9 +39,6 @@ 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 @@ -50,12 +46,6 @@ data ShelleyToAllegraEra era where 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 @@ -95,7 +85,6 @@ type ShelleyToAllegraEraConstraints era = , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era - , IsShelleyToAllegraEra era , ToJSON (DebugLedgerState era) , Typeable era ) diff --git a/cardano-api/internal/Cardano/Api/Eon/ShelleyToAlonzoEra.hs b/cardano-api/internal/Cardano/Api/Eon/ShelleyToAlonzoEra.hs index 66d22f8c8f..8ef4552d99 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ShelleyToAlonzoEra.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ShelleyToAlonzoEra.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.ShelleyToAlonzoEra ( ShelleyToAlonzoEra(..) - , IsShelleyToAlonzoEra(..) , AnyShelleyToAlonzoEra(..) , shelleyToAlonzoEraConstraints , shelleyToAlonzoEraToCardanoEra @@ -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 @@ -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 @@ -104,7 +88,6 @@ type ShelleyToAlonzoEraConstraints era = , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era - , IsShelleyToAlonzoEra era , ToJSON (DebugLedgerState era) , Typeable era ) diff --git a/cardano-api/internal/Cardano/Api/Eon/ShelleyToBabbageEra.hs b/cardano-api/internal/Cardano/Api/Eon/ShelleyToBabbageEra.hs index aa2c617176..adb5490c38 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ShelleyToBabbageEra.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ShelleyToBabbageEra.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.ShelleyToBabbageEra ( ShelleyToBabbageEra(..) - , IsShelleyToBabbageEra(..) , AnyShelleyToBabbageEra(..) , shelleyToBabbageEraConstraints , shelleyToBabbageEraToCardanoEra @@ -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 @@ -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 @@ -108,7 +89,6 @@ type ShelleyToBabbageEraConstraints era = , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era - , IsShelleyToBabbageEra era , ToJSON (DebugLedgerState era) , Typeable era ) diff --git a/cardano-api/internal/Cardano/Api/Eon/ShelleyToMaryEra.hs b/cardano-api/internal/Cardano/Api/Eon/ShelleyToMaryEra.hs index 3510890df9..d355b8cf51 100644 --- a/cardano-api/internal/Cardano/Api/Eon/ShelleyToMaryEra.hs +++ b/cardano-api/internal/Cardano/Api/Eon/ShelleyToMaryEra.hs @@ -10,7 +10,6 @@ module Cardano.Api.Eon.ShelleyToMaryEra ( ShelleyToMaryEra(..) - , IsShelleyToMaryEra(..) , AnyShelleyToMaryEra(..) , shelleyToMaryEraConstraints , shelleyToMaryEraToCardanoEra @@ -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 @@ -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 @@ -100,7 +87,6 @@ type ShelleyToMaryEraConstraints era = , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era - , IsShelleyToMaryEra era , ToJSON (DebugLedgerState era) , Typeable era ) diff --git a/cardano-api/src/Cardano/Api.hs b/cardano-api/src/Cardano/Api.hs index f83d3d235e..8e9bf7f3f9 100644 --- a/cardano-api/src/Cardano/Api.hs +++ b/cardano-api/src/Cardano/Api.hs @@ -44,62 +44,53 @@ module Cardano.Api ( -- * Features ByronEraOnly(..), - IsByronEraOnly(..), AnyByronEraOnly(..), byronEraOnlyConstraints, byronEraOnlyToCardanoEra, ShelleyToBabbageEra(..), - IsShelleyToBabbageEra(..), AnyShelleyToBabbageEra(..), shelleyToBabbageEraConstraints, shelleyToBabbageEraToCardanoEra, shelleyToBabbageEraToShelleyBasedEra, ShelleyToAllegraEra(..), - IsShelleyToAllegraEra(..), AnyShelleyToAllegraEra(..), shelleyToAllegraEraConstraints, shelleyToAllegraEraToCardanoEra, shelleyToAllegraEraToShelleyBasedEra, ShelleyToAlonzoEra(..), - IsShelleyToAlonzoEra(..), AnyShelleyToAlonzoEra(..), shelleyToAlonzoEraConstraints, shelleyToAlonzoEraToCardanoEra, shelleyToAlonzoEraToShelleyBasedEra, ShelleyToMaryEra(..), - IsShelleyToMaryEra(..), AnyShelleyToMaryEra(..), shelleyToMaryEraConstraints, shelleyToMaryEraToCardanoEra, shelleyToMaryEraToShelleyBasedEra, AlonzoEraOnwards(..), - IsAlonzoEraOnwards(..), AnyAlonzoEraOnwards(..), alonzoEraOnwardsConstraints, alonzoEraOnwardsToCardanoEra, alonzoEraOnwardsToShelleyBasedEra, AlonzoEraOnly(..), - IsAlonzoEraOnly(..), AnyAlonzoEraOnly(..), alonzoEraOnlyConstraints, alonzoEraOnlyToCardanoEra, alonzoEraOnlyToShelleyBasedEra, BabbageEraOnwards(..), - IsBabbageEraOnwards(..), AnyBabbageEraOnwards(..), babbageEraOnwardsConstraints, babbageEraOnwardsToCardanoEra, babbageEraOnwardsToShelleyBasedEra, ConwayEraOnwards(..), - IsConwayEraOnwards(..), AnyConwayEraOnwards(..), conwayEraOnwardsConstraints, conwayEraOnwardsToCardanoEra,