Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Api.Experimental.Era
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 = (AllegraEraScript (LedgerEra era), AlonzoEraTx (LedgerEra era), BabbageEraPParams (LedgerEra era), BabbageEraTxBody (LedgerEra era), ConwayEraTxCert (LedgerEra era), Era (LedgerEra era), EraScript (LedgerEra era), EraTx (LedgerEra era), EraTxCert (LedgerEra era), EraTxOut (LedgerEra era), EraUTxO (LedgerEra era), NativeScript (LedgerEra era) ~ Timelock (LedgerEra era), ShelleyEraTxCert (LedgerEra era), ShelleyLedgerEra era ~ LedgerEra era, HashAnnotated (TxBody (LedgerEra era)) EraIndependentTxBody, IsCardanoEra era, IsShelleyBasedEra era, IsEra era)
- obtainCommonConstraints :: Era era -> (EraCommonConstraints era => a) -> a
- eraToSbe :: Era era -> ShelleyBasedEra 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
IsCardanoEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Core Methods | |||||
IsAllegraBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.AllegraEraOnwards Methods | |||||
IsAlonzoBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.AlonzoEraOnwards Methods | |||||
IsBabbageBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.BabbageEraOnwards Methods | |||||
IsConwayBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.ConwayEraOnwards Methods | |||||
IsMaryBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.MaryEraOnwards Methods | |||||
IsShelleyBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Eon.ShelleyBasedEra Methods | |||||
IsEra ConwayEra Source # | |||||
HasTypeProxy ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.Core Associated Types
| |||||
HasScriptLanguageInEra PlutusScriptV1 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script | |||||
HasScriptLanguageInEra PlutusScriptV2 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script | |||||
HasScriptLanguageInEra PlutusScriptV3 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script | |||||
ToAlonzoScript PlutusScriptV1 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV1 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
ToAlonzoScript PlutusScriptV2 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV2 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
ToAlonzoScript PlutusScriptV3 ConwayEra Source # | |||||
Defined in Cardano.Api.Plutus.Internal.Script Methods toLedgerScript :: PlutusScript PlutusScriptV3 -> AlonzoScript (ShelleyLedgerEra ConwayEra) Source # | |||||
data AsType ConwayEra Source # | |||||
Defined in Cardano.Api.Era.Internal.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.
Instances
Eon Era Source # | A temporary compatibility instance for easier conversion between the experimental and old APIs. |
Defined in Cardano.Api.Experimental.Era Methods inEonForEra :: a -> (Era era -> a) -> CardanoEra era -> a Source # | |
ToCardanoEra Era Source # | A temporary compatibility instance for easier conversion between the experimental and old APIs. |
Defined in Cardano.Api.Experimental.Era Methods toCardanoEra :: Era era -> CardanoEra era Source # | |
TestEquality Era Source # | |
Defined in Cardano.Api.Experimental.Era | |
Convert ConwayEraOnwards Era Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: ConwayEraOnwards era -> Era era Source # | |
Convert Era CardanoEra Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> CardanoEra era Source # | |
Convert Era AlonzoEraOnwards Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> AlonzoEraOnwards era Source # | |
Convert Era BabbageEraOnwards Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> BabbageEraOnwards era Source # | |
Convert Era ConwayEraOnwards Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> ConwayEraOnwards era Source # | |
Convert Era MaryEraOnwards Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> MaryEraOnwards era Source # | |
Convert Era ShelleyBasedEra Source # | |
Defined in Cardano.Api.Experimental.Era Methods convert :: Era era -> ShelleyBasedEra era Source # | |
ToJSON (Era era) Source # | |
Defined in Cardano.Api.Experimental.Era | |
Show (Era era) Source # | |
Eq (Era era) Source # | |
Pretty (Era era) Source # | |
Defined in Cardano.Api.Experimental.Era | |
FromJSON (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Era | |
ToJSON (Some Era) Source # | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Era 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.Experimental.Era | |
Pretty (Some Era) 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.Experimental.Era | |
ToJSON (Some Era) Source # | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Era 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.Experimental.Era | |
Pretty (Some Era) Source # | |
class Inject t s where Source #
Instances
Inject Coin DeltaCoin | |
Inject Coin MaryValue | |
Inject a a | |
Defined in Cardano.Ledger.BaseTypes | |
Inject (BabbageContextError era) (ConwayContextError era) | |
Defined in Cardano.Ledger.Conway.TxInfo Methods inject :: BabbageContextError era -> ConwayContextError era Source # | |
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 # |
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.Experimental.Era | |
Pretty (DeprecatedEra era) Source # | |
Defined in Cardano.Api.Experimental.Era |
type EraCommonConstraints era = (AllegraEraScript (LedgerEra era), AlonzoEraTx (LedgerEra era), BabbageEraPParams (LedgerEra era), BabbageEraTxBody (LedgerEra era), ConwayEraTxCert (LedgerEra era), Era (LedgerEra era), EraScript (LedgerEra era), EraTx (LedgerEra era), EraTxCert (LedgerEra era), EraTxOut (LedgerEra era), EraUTxO (LedgerEra era), NativeScript (LedgerEra era) ~ Timelock (LedgerEra era), ShelleyEraTxCert (LedgerEra era), ShelleyLedgerEra era ~ LedgerEra era, HashAnnotated (TxBody (LedgerEra era)) EraIndependentTxBody, IsCardanoEra era, IsShelleyBasedEra era, 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
eraToBabbageEraOnwards :: Era era -> BabbageEraOnwards era Source #
Deprecated: Use convert
instead.
sbeToEra :: MonadError (DeprecatedEra era) m => ShelleyBasedEra era -> m (Era era) Source #