{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} module Cardano.Api.Eon.ShelleyEraOnly ( ShelleyEraOnly (..) , shelleyEraOnlyConstraints , shelleyEraOnlyToShelleyBasedEra , ShelleyEraOnlyConstraints ) where 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.Api as L import qualified Cardano.Ledger.BaseTypes as L import qualified Cardano.Ledger.Coin as L import qualified Cardano.Ledger.Core as L import qualified Cardano.Ledger.SafeHash as L import qualified Cardano.Ledger.Shelley.TxCert 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 ShelleyEraOnly era where ShelleyEraOnlyShelley :: ShelleyEraOnly ShelleyEra deriving instance Show (ShelleyEraOnly era) deriving instance Eq (ShelleyEraOnly era) instance Eon ShelleyEraOnly where inEonForEra :: forall a era. a -> (ShelleyEraOnly era -> a) -> CardanoEra era -> a inEonForEra a no ShelleyEraOnly era -> a yes = \case CardanoEra era ByronEra -> a no CardanoEra era ShelleyEra -> ShelleyEraOnly era -> a yes ShelleyEraOnly era ShelleyEraOnly ShelleyEra ShelleyEraOnlyShelley CardanoEra era AllegraEra -> a no CardanoEra era MaryEra -> a no CardanoEra era AlonzoEra -> a no CardanoEra era BabbageEra -> a no CardanoEra era ConwayEra -> a no instance ToCardanoEra ShelleyEraOnly where toCardanoEra :: forall era. ShelleyEraOnly era -> CardanoEra era toCardanoEra = \case ShelleyEraOnly era ShelleyEraOnlyShelley -> CardanoEra era CardanoEra ShelleyEra ShelleyEra instance Convert ShelleyEraOnly CardanoEra where convert :: forall era. ShelleyEraOnly era -> CardanoEra era convert = ShelleyEraOnly era -> CardanoEra era forall era. ShelleyEraOnly era -> CardanoEra era forall (eon :: * -> *) era. ToCardanoEra eon => eon era -> CardanoEra era toCardanoEra instance Convert ShelleyEraOnly ShelleyBasedEra where convert :: forall era. ShelleyEraOnly era -> ShelleyBasedEra era convert = \case ShelleyEraOnly era ShelleyEraOnlyShelley -> ShelleyBasedEra era ShelleyBasedEra ShelleyEra ShelleyBasedEraShelley type ShelleyEraOnlyConstraints 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.Crypto (L.EraCrypto (ShelleyLedgerEra era)) , L.Era (ShelleyLedgerEra era) , L.EraCrypto (ShelleyLedgerEra era) ~ L.StandardCrypto , L.EraPParams (ShelleyLedgerEra era) , L.EraTx (ShelleyLedgerEra era) , L.EraTxBody (ShelleyLedgerEra era) , L.EraTxOut (ShelleyLedgerEra era) , L.ExactEra L.ShelleyEra (ShelleyLedgerEra era) , L.ExactEra L.ShelleyEra (ShelleyLedgerEra era) , L.HashAnnotated (L.TxBody (ShelleyLedgerEra era)) L.EraIndependentTxBody L.StandardCrypto , L.ProtVerAtMost (ShelleyLedgerEra era) 2 , L.ProtVerAtMost (ShelleyLedgerEra era) 6 , L.ProtVerAtMost (ShelleyLedgerEra era) 8 , L.ShelleyEraTxBody (ShelleyLedgerEra era) , L.ShelleyEraTxCert (ShelleyLedgerEra era) , L.TxCert (ShelleyLedgerEra era) ~ L.ShelleyTxCert (ShelleyLedgerEra era) , L.Value (ShelleyLedgerEra era) ~ L.Coin , FromCBOR (Consensus.ChainDepState (ConsensusProtocol era)) , FromCBOR (DebugLedgerState era) , IsCardanoEra era , IsShelleyBasedEra era , ToJSON (DebugLedgerState era) , Typeable era ) shelleyEraOnlyConstraints :: () => ShelleyEraOnly era -> (ShelleyEraOnlyConstraints era => a) -> a shelleyEraOnlyConstraints :: forall era a. ShelleyEraOnly era -> (ShelleyEraOnlyConstraints era => a) -> a shelleyEraOnlyConstraints = \case ShelleyEraOnly era ShelleyEraOnlyShelley -> a -> a (ShelleyEraOnlyConstraints era => a) -> a forall a. a -> a id {-# DEPRECATED shelleyEraOnlyToShelleyBasedEra "Use 'convert' instead." #-} shelleyEraOnlyToShelleyBasedEra :: ShelleyEraOnly era -> ShelleyBasedEra era shelleyEraOnlyToShelleyBasedEra :: forall era. ShelleyEraOnly era -> ShelleyBasedEra era shelleyEraOnlyToShelleyBasedEra = ShelleyEraOnly era -> ShelleyBasedEra era forall era. ShelleyEraOnly era -> ShelleyBasedEra era forall a (f :: a -> *) (g :: a -> *) (era :: a). Convert f g => f era -> g era convert