{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Cardano.Api.Eon.ConwayEraOnwards ( ConwayEraOnwards (..) , conwayEraOnwardsConstraints , conwayEraOnwardsToShelleyBasedEra , conwayEraOnwardsToBabbageEraOnwards , ConwayEraOnwardsConstraints , IsConwayBasedEra (..) ) where import Cardano.Api.Eon.AllegraEraOnwards (AllegraEraOnwards (..)) import Cardano.Api.Eon.BabbageEraOnwards import Cardano.Api.Eon.Convert import Cardano.Api.Eon.ShelleyBasedEra import Cardano.Api.Eras.Core import Cardano.Api.Modes import Cardano.Api.Query.Types import Cardano.Binary import qualified Cardano.Crypto.Hash.Blake2b as Blake2b import qualified Cardano.Crypto.Hash.Class as C import qualified Cardano.Crypto.VRF as C import qualified Cardano.Ledger.Alonzo.Scripts as L import qualified Cardano.Ledger.Alonzo.UTxO as L import qualified Cardano.Ledger.Api as L import qualified Cardano.Ledger.BaseTypes as L import qualified Cardano.Ledger.Conway.Core as L import qualified Cardano.Ledger.Conway.Governance as L import qualified Cardano.Ledger.Conway.TxCert as L import qualified Cardano.Ledger.Mary.Value as L import qualified Cardano.Ledger.SafeHash as L import qualified Cardano.Ledger.UTxO as L import qualified Ouroboros.Consensus.Protocol.Abstract as Consensus import qualified Ouroboros.Consensus.Protocol.Praos.Common as Consensus import qualified Ouroboros.Consensus.Shelley.Ledger as Consensus import Data.Aeson import Data.Typeable (Typeable) data ConwayEraOnwards era where ConwayEraOnwardsConway :: ConwayEraOnwards ConwayEra deriving instance Show (ConwayEraOnwards era) deriving instance Eq (ConwayEraOnwards era) instance Eon ConwayEraOnwards where inEonForEra :: forall a era. a -> (ConwayEraOnwards era -> a) -> CardanoEra era -> a inEonForEra a no ConwayEraOnwards era -> a yes = \case CardanoEra era ByronEra -> a no CardanoEra era ShelleyEra -> a no CardanoEra era AllegraEra -> a no CardanoEra era MaryEra -> a no CardanoEra era AlonzoEra -> a no CardanoEra era BabbageEra -> a no CardanoEra era ConwayEra -> ConwayEraOnwards era -> a yes ConwayEraOnwards era ConwayEraOnwards ConwayEra ConwayEraOnwardsConway instance ToCardanoEra ConwayEraOnwards where toCardanoEra :: forall era. ConwayEraOnwards era -> CardanoEra era toCardanoEra = \case ConwayEraOnwards era ConwayEraOnwardsConway -> CardanoEra era CardanoEra ConwayEra ConwayEra instance Convert ConwayEraOnwards CardanoEra where convert :: forall era. ConwayEraOnwards era -> CardanoEra era convert = ConwayEraOnwards era -> CardanoEra era forall era. ConwayEraOnwards era -> CardanoEra era forall (eon :: * -> *) era. ToCardanoEra eon => eon era -> CardanoEra era toCardanoEra instance Convert ConwayEraOnwards ShelleyBasedEra where convert :: forall era. ConwayEraOnwards era -> ShelleyBasedEra era convert = \case ConwayEraOnwards era ConwayEraOnwardsConway -> ShelleyBasedEra era ShelleyBasedEra ConwayEra ShelleyBasedEraConway instance Convert ConwayEraOnwards AllegraEraOnwards where convert :: forall era. ConwayEraOnwards era -> AllegraEraOnwards era convert = \case ConwayEraOnwards era ConwayEraOnwardsConway -> AllegraEraOnwards era AllegraEraOnwards ConwayEra AllegraEraOnwardsConway instance Convert ConwayEraOnwards BabbageEraOnwards where convert :: forall era. ConwayEraOnwards era -> BabbageEraOnwards era convert = \case ConwayEraOnwards era ConwayEraOnwardsConway -> BabbageEraOnwards era BabbageEraOnwards ConwayEra BabbageEraOnwardsConway type ConwayEraOnwardsConstraints era = ( C.HashAlgorithm (L.HASH (L.EraCrypto (ShelleyLedgerEra era))) , C.Signable (L.VRF (L.EraCrypto (ShelleyLedgerEra era))) L.Seed , Consensus.PraosProtocolSupportsNode (ConsensusProtocol era) , Consensus.ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era) ~ ConsensusBlockForEra era , Consensus.ShelleyCompatible (ConsensusProtocol era) (ShelleyLedgerEra era) , L.ADDRHASH (Consensus.PraosProtocolSupportsNodeCrypto (ConsensusProtocol era)) ~ Blake2b.Blake2b_224 , L.AlonzoEraTxOut (ShelleyLedgerEra era) , L.AlonzoEraTxWits (ShelleyLedgerEra era) , L.BabbageEraTxBody (ShelleyLedgerEra era) , L.ConwayEraGov (ShelleyLedgerEra era) , L.ConwayEraPParams (ShelleyLedgerEra era) , L.ConwayEraTxBody (ShelleyLedgerEra era) , L.ConwayEraTxCert (ShelleyLedgerEra era) , L.Crypto (L.EraCrypto (ShelleyLedgerEra era)) , L.Era (ShelleyLedgerEra era) , L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto , L.EraGov (ShelleyLedgerEra era) , L.EraPParams (ShelleyLedgerEra era) , L.EraTx (ShelleyLedgerEra era) , L.EraTxBody (ShelleyLedgerEra era) , L.EraTxOut (ShelleyLedgerEra era) , L.EraUTxO (ShelleyLedgerEra era) , L.GovState (ShelleyLedgerEra era) ~ L.ConwayGovState (ShelleyLedgerEra era) , L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto , L.MaryEraTxBody (ShelleyLedgerEra era) , L.Script (ShelleyLedgerEra era) ~ L.AlonzoScript (ShelleyLedgerEra era) , L.ScriptsNeeded (ShelleyLedgerEra era) ~ L.AlonzoScriptsNeeded (ShelleyLedgerEra era) , L.ShelleyEraTxCert (ShelleyLedgerEra era) , L.TxCert (ShelleyLedgerEra era) ~ L.ConwayTxCert (ShelleyLedgerEra era) , L.Value (ShelleyLedgerEra era) ~ L.MaryValue L.StandardCrypto , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era , ToJSON (DebugLedgerState era) , Typeable era ) conwayEraOnwardsConstraints :: () => ConwayEraOnwards era -> (ConwayEraOnwardsConstraints era => a) -> a conwayEraOnwardsConstraints :: forall era a. ConwayEraOnwards era -> (ConwayEraOnwardsConstraints era => a) -> a conwayEraOnwardsConstraints = \case ConwayEraOnwards era ConwayEraOnwardsConway -> a -> a (ConwayEraOnwardsConstraints era => a) -> a forall a. a -> a id {-# DEPRECATED conwayEraOnwardsToShelleyBasedEra "Use 'convert' instead." #-} conwayEraOnwardsToShelleyBasedEra :: ConwayEraOnwards era -> ShelleyBasedEra era conwayEraOnwardsToShelleyBasedEra :: forall era. ConwayEraOnwards era -> ShelleyBasedEra era conwayEraOnwardsToShelleyBasedEra = ConwayEraOnwards era -> ShelleyBasedEra era forall era. ConwayEraOnwards era -> ShelleyBasedEra era forall a (f :: a -> *) (g :: a -> *) (era :: a). Convert f g => f era -> g era convert {-# DEPRECATED conwayEraOnwardsToBabbageEraOnwards "Use 'convert' instead." #-} conwayEraOnwardsToBabbageEraOnwards :: ConwayEraOnwards era -> BabbageEraOnwards era conwayEraOnwardsToBabbageEraOnwards :: forall era. ConwayEraOnwards era -> BabbageEraOnwards era conwayEraOnwardsToBabbageEraOnwards = ConwayEraOnwards era -> BabbageEraOnwards era forall era. ConwayEraOnwards era -> BabbageEraOnwards era forall a (f :: a -> *) (g :: a -> *) (era :: a). Convert f g => f era -> g era convert class IsBabbageBasedEra era => IsConwayBasedEra era where conwayBasedEra :: ConwayEraOnwards era instance IsConwayBasedEra ConwayEra where conwayBasedEra :: ConwayEraOnwards ConwayEra conwayBasedEra = ConwayEraOnwards ConwayEra ConwayEraOnwardsConway