Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 # | |||||
IsAlonzoBasedEra ConwayEra Source # | |||||
IsBabbageBasedEra ConwayEra Source # | |||||
IsConwayBasedEra ConwayEra Source # | |||||
IsMaryBasedEra ConwayEra Source # | |||||
Defined in Cardano.Api.Eon.MaryEraOnwards | |||||
IsShelleyBasedEra ConwayEra Source # | |||||
IsCardanoEra ConwayEra Source # | |||||
Defined in Cardano.Api.Eras.Core | |||||
IsEra ConwayEra Source # | |||||
HasTypeProxy ConwayEra Source # | |||||
Defined in Cardano.Api.Eras.Core
| |||||
HasScriptLanguageInEra PlutusScriptV1 ConwayEra Source # | |||||
HasScriptLanguageInEra PlutusScriptV2 ConwayEra Source # | |||||
HasScriptLanguageInEra PlutusScriptV3 ConwayEra Source # | |||||
ToAlonzoScript PlutusScriptV1 ConwayEra Source # | |||||
Defined in Cardano.Api.Script | |||||
ToAlonzoScript PlutusScriptV2 ConwayEra Source # | |||||
Defined in Cardano.Api.Script | |||||
ToAlonzoScript PlutusScriptV3 ConwayEra Source # | |||||
Defined in Cardano.Api.Script | |||||
data AsType ConwayEra Source # | |||||
Defined in Cardano.Api.Eras.Core |
Represents the eras in Cardano's blockchain. This type represents eras currently on mainnet and new eras which are in development.
After a hardfork, the era from which we hardfork from gets deprecated and after deprecation period, gets removed. During deprecation period, consumers of cardano-api should update their codebase to the mainnet era.
BabbageEra :: Era BabbageEra | The era currently active on Cardano's mainnet. |
ConwayEra :: Era ConwayEra | The upcoming era in development. |
Instances
Eon Era Source # | A temporary compatibility instance, for easier conversion between experimental and old API. |
Defined in Cardano.Api.Experimental.Eras inEonForEra :: a -> (Era era -> a) -> CardanoEra era -> a Source # | |
TestEquality Era Source # | |
Defined in Cardano.Api.Experimental.Eras | |
Convert BabbageEraOnwards Era Source # | |
Defined in Cardano.Api.Experimental.Eras convert :: BabbageEraOnwards era -> Era era Source # | |
Convert Era BabbageEraOnwards Source # | |
Defined in Cardano.Api.Experimental.Eras convert :: Era era -> BabbageEraOnwards era Source # | |
Convert Era ShelleyBasedEra Source # | |
Defined in Cardano.Api.Experimental.Eras convert :: Era era -> ShelleyBasedEra era Source # | |
Convert Era CardanoEra Source # | |
Defined in Cardano.Api.Experimental.Eras convert :: Era era -> CardanoEra era Source # | |
ToJSON (Era era) Source # | |
Defined in Cardano.Api.Experimental.Eras | |
Show (Era era) Source # | |
Eq (Era era) Source # | |
Pretty (Era era) Source # | |
Defined in Cardano.Api.Experimental.Eras | |
FromJSON (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Eras | |
ToJSON (Some Era) Source # | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Eras 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.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.Experimental.Eras useEra :: Era BabbageEra Source # | |
IsEra ConwayEra Source # | |
data Some (f :: k -> Type) where Source #
An existential wrapper for types of kind k -> Types
. Use it to hold any era e.g. Some Era
. One can
then bring the era witness back into scope for example using this pattern:
anyEra = Some ConwayEra
-- then later in the code
Some era <- pure anyEra
obtainCommonConstraints era foo
Instances
FromJSON (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Eras | |
ToJSON (Some Era) Source # | |
Bounded (Some Era) Source # | |
Enum (Some Era) Source # | |
Defined in Cardano.Api.Experimental.Eras 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.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 inject :: AlonzoContextError era -> BabbageContextError era Source # | |
Inject (AlonzoContextError era) (ConwayContextError era) | |
Defined in Cardano.Ledger.Conway.TxInfo inject :: AlonzoContextError era -> ConwayContextError era Source # | |
Inject (BabbageContextError era) (ConwayContextError era) | |
Defined in Cardano.Ledger.Conway.TxInfo 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. Hence, the protocol versions are limited to the current mainnet era and the next era (upcoming era).
newtype DeprecatedEra era Source #
DeprecatedEra (ShelleyBasedEra era) |
Instances
Show (DeprecatedEra era) Source # | |
Defined in Cardano.Api.Experimental.Eras | |
Pretty (DeprecatedEra era) Source # | |
Defined in Cardano.Api.Experimental.Eras pretty :: DeprecatedEra era -> Doc ann # prettyList :: [DeprecatedEra era] -> Doc ann # |
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 DEPRECATED pragma to the era type tag and the era constructor at the same time:
{-# DEPRECATED BabbageEra "BabbageEra no longer supported, use ConwayEra" #-} data BabbageEra
- Update haddock for the constructor of the deprecated era, mentioning 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 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 #