Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Internal.Experimental.Eras
Description
This module defines the protocol versions corresponding to the eras in the Cardano blockchain.
Synopsis
- data BabbageEra
- data ConwayEra
- data Era era where
- class IsEra era where
- data Some (f :: k -> Type) where
- class Inject t s where
- inject :: t -> s
- type family LedgerEra era = (r :: Type) | r -> era where ...
- newtype DeprecatedEra era = DeprecatedEra (ShelleyBasedEra era)
- type EraCommonConstraints era = (AlonzoEraTx (LedgerEra era), BabbageEraTxBody (LedgerEra era), EraTx (LedgerEra era), EraUTxO (LedgerEra era), EraCrypto (LedgerEra era) ~ StandardCrypto, ShelleyLedgerEra era ~ LedgerEra era, HashAnnotated (TxBody (LedgerEra era)) EraIndependentTxBody StandardCrypto, IsEra era)
- obtainCommonConstraints :: Era era -> (EraCommonConstraints era => a) -> a
- eraToSbe :: Era era -> ShelleyBasedEra era
- babbageEraOnwardsToEra :: BabbageEraOnwards era -> Era era
- eraToBabbageEraOnwards :: Era era -> BabbageEraOnwards era
- sbeToEra :: MonadError (DeprecatedEra era) m => ShelleyBasedEra era -> m (Era era)
Documentation
data BabbageEra Source #
A type used as a tag to distinguish the Babbage era.
Instances
A type used as a tag to distinguish the Conway era.
Instances
IsAllegraBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.AllegraEraOnwards Methods | |||||
IsAlonzoBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.AlonzoEraOnwards Methods | |||||
IsBabbageBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.BabbageEraOnwards Methods | |||||
IsConwayBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.ConwayEraOnwards Methods | |||||
IsMaryBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.MaryEraOnwards Methods | |||||
IsShelleyBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eon.ShelleyBasedEra Methods | |||||
IsCardanoEra ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eras.Core Methods | |||||
IsEra ConwayEra Source # | |||||
HasTypeProxy ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eras.Core Associated Types
| |||||
HasScriptLanguageInEra PlutusScriptV1 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script | |||||
HasScriptLanguageInEra PlutusScriptV2 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script | |||||
HasScriptLanguageInEra PlutusScriptV3 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script | |||||
ToAlonzoScript PlutusScriptV1 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV1 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
ToAlonzoScript PlutusScriptV2 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV2 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
ToAlonzoScript PlutusScriptV3 ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV3 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
data AsType ConwayEra Source # | |||||
Defined in Cardano.Api.Internal.Eras.Core |
Represents the latest Cardano blockchain eras, including the one currently on mainnet and the upcoming one.
After a hard fork takes place, the era on mainnet before the hard fork
is deprecated and, after a deprecation period, removed from cardano-api
.
During the deprecation period, cardano-api
users should update their
codebase to the new mainnet era.
Constructors
BabbageEra :: Era BabbageEra | The currently active era on the Cardano mainnet. |
ConwayEra :: Era ConwayEra | The upcoming era in development. |
Instances
Eon Era Source # | A temporary compatibility instance for easier conversion between the experimental and old APIs. |
Defined in Cardano.Api.Internal.Experimental.Eras Methods inEonForEra :: a -> (Era era -> a) -> CardanoEra era -> a Source # | |
TestEquality Era Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Convert BabbageEraOnwards Era Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods convert :: BabbageEraOnwards era -> Era era Source # | |
Convert Era BabbageEraOnwards Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods convert :: Era era -> BabbageEraOnwards era Source # | |
Convert Era ShelleyBasedEra Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods convert :: Era era -> ShelleyBasedEra era Source # | |
Convert Era CardanoEra Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods convert :: Era era -> CardanoEra era Source # | |
ToJSON (Era era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods toEncoding :: Era era -> Encoding toJSONList :: [Era era] -> Value toEncodingList :: [Era era] -> Encoding | |
Show (Era era) Source # | |
Eq (Era era) Source # | |
Pretty (Era era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
FromJSON (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods parseJSON :: Value -> Parser (Some Era) parseJSONList :: Value -> Parser [Some Era] omittedField :: Maybe (Some Era) | |
ToJSON (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods succ :: Some Era -> Some Era Source # pred :: Some Era -> Some Era Source # toEnum :: Int -> Some Era Source # fromEnum :: Some Era -> Int Source # enumFrom :: Some Era -> [Some Era] Source # enumFromThen :: Some Era -> Some Era -> [Some Era] Source # enumFromTo :: Some Era -> Some Era -> [Some Era] Source # enumFromThenTo :: Some Era -> Some Era -> Some Era -> [Some Era] Source # | |
Show (Some Era) Source # | |
Eq (Some Era) Source # | |
Ord (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Pretty (Some Era) Source # | |
class IsEra era where Source #
Type class interface for the Era
type.
Instances
IsEra BabbageEra Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods useEra :: Era BabbageEra Source # | |
IsEra ConwayEra Source # | |
data Some (f :: k -> Type) where Source #
An existential wrapper for types of kind k -> Type
. It can hold any
era, for example, Some Era
. The era witness can be brought back into scope,
for example, using this pattern:
anyEra = Some ConwayEra -- then later in the code Some era <- pure anyEra obtainCommonConstraints era foo
Constructors
Some :: forall {k} (f :: k -> Type) (a :: k). (Typeable a, Typeable (f a)) => f a -> Some f |
Instances
FromJSON (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods parseJSON :: Value -> Parser (Some Era) parseJSONList :: Value -> Parser [Some Era] omittedField :: Maybe (Some Era) | |
ToJSON (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras Methods succ :: Some Era -> Some Era Source # pred :: Some Era -> Some Era Source # toEnum :: Int -> Some Era Source # fromEnum :: Some Era -> Int Source # enumFrom :: Some Era -> [Some Era] Source # enumFromThen :: Some Era -> Some Era -> [Some Era] Source # enumFromTo :: Some Era -> Some Era -> [Some Era] Source # enumFromThenTo :: Some Era -> Some Era -> Some Era -> [Some Era] Source # | |
Show (Some Era) Source # | |
Eq (Some Era) Source # | |
Ord (Some Era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Pretty (Some Era) Source # | |
class Inject t s where Source #
Instances
Inject Coin DeltaCoin | |
Inject a a | |
Defined in Cardano.Ledger.BaseTypes | |
Inject Coin (MaryValue c) | |
Inject (AlonzoContextError era) (BabbageContextError era) | |
Defined in Cardano.Ledger.Babbage.TxInfo Methods inject :: AlonzoContextError era -> BabbageContextError era Source # | |
Inject (AlonzoContextError era) (ConwayContextError era) | |
Defined in Cardano.Ledger.Conway.TxInfo Methods inject :: AlonzoContextError era -> ConwayContextError era Source # | |
Inject (BabbageContextError era) (ConwayContextError era) | |
Defined in Cardano.Ledger.Conway.TxInfo Methods inject :: BabbageContextError era -> ConwayContextError era Source # |
type family LedgerEra era = (r :: Type) | r -> era where ... Source #
Users typically interact with the latest features on the mainnet or experiment with features from the upcoming era. Therefore, protocol versions are limited to the current mainnet era and the next (upcoming) era.
newtype DeprecatedEra era Source #
Constructors
DeprecatedEra (ShelleyBasedEra era) |
Instances
Show (DeprecatedEra era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras | |
Pretty (DeprecatedEra era) Source # | |
Defined in Cardano.Api.Internal.Experimental.Eras |
type EraCommonConstraints era = (AlonzoEraTx (LedgerEra era), BabbageEraTxBody (LedgerEra era), EraTx (LedgerEra era), EraUTxO (LedgerEra era), EraCrypto (LedgerEra era) ~ StandardCrypto, ShelleyLedgerEra era ~ LedgerEra era, HashAnnotated (TxBody (LedgerEra era)) EraIndependentTxBody StandardCrypto, IsEra era) Source #
obtainCommonConstraints :: Era era -> (EraCommonConstraints era => a) -> a Source #
eraToSbe :: Era era -> ShelleyBasedEra era Source #
Deprecated: Use convert
instead.
How to deprecate an era:
- Add the DEPRECATED pragma to the era type tag and constructor at the same time:
{-# DEPRECATED BabbageEra "BabbageEra no longer supported, use ConwayEra" #-} data BabbageEra
- Update the Haddock documentation for the constructor of the deprecated era, mentioning the deprecation.
data Era era where {-# DEPRECATED BabbageEra "BabbageEra no longer supported, use ConwayEra" #-} BabbageEra :: Era BabbageEra -- | The era currently active on Cardano's mainnet. ConwayEra :: Era ConwayEra
- Add a new
IsEra
instance and update the deprecated era instance to produce a compile-time error:
instance TypeError ('Text "IsEra BabbageEra: Deprecated. Update to ConwayEra") => IsEra BabbageEra where useEra = error "unreachable" instance IsEra ConwayEra where useEra = ConwayEra
babbageEraOnwardsToEra :: BabbageEraOnwards era -> Era era Source #
Deprecated: Use convert
instead.
eraToBabbageEraOnwards :: Era era -> BabbageEraOnwards era Source #
Deprecated: Use convert
instead.
sbeToEra :: MonadError (DeprecatedEra era) m => ShelleyBasedEra era -> m (Era era) Source #