Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type AllegraEra = ShelleyMAEra ' Allegra
- data AlonzoEra c
- data BabbageEra c
- type MaryEra c = ShelleyMAEra ' Mary c
- data ShelleyEra c
- type StandardAllegra = AllegraEra StandardCrypto
- type StandardAlonzo = AlonzoEra StandardCrypto
- type StandardBabbage = BabbageEra StandardCrypto
- type StandardMary = MaryEra StandardCrypto
- type StandardShelley = ShelleyEra StandardCrypto
-
class
(
ShelleyBasedEra
era,
GetLedgerView
era,
State
(
EraRule
"PPUP" era) ~
PPUPState
era,
Default
(
State
(
EraRule
"PPUP" era)),
HasField
"_maxBBSize" (
PParams
era)
Natural
,
HasField
"_maxBHSize" (
PParams
era)
Natural
,
HasField
"_maxTxSize" (
PParams
era)
Natural
,
HasField
"_a0" (
PParams
era)
NonNegativeInterval
,
HasField
"_nOpt" (
PParams
era)
Natural
,
HasField
"_rho" (
PParams
era)
UnitInterval
,
HasField
"_tau" (
PParams
era)
UnitInterval
,
ValidateScript
era,
FromCBOR
(
PParams
era),
ToCBOR
(
PParams
era),
HasField
"_protocolVersion" (
PParamsDelta
era) (
StrictMaybe
ProtVer
),
FromCBOR
(
PParamsDelta
era),
AdditionalGenesisConfig
era ~
TranslationContext
era,
ToCBORGroup
(
TxSeq
era),
NoThunks
(
TranslationContext
era),
FromCBOR
(
Annotator
(
Witnesses
era)),
ToCBOR
(
Witnesses
era),
Eq
(
TxSeq
era),
Show
(
TxSeq
era),
FromCBOR
(
Annotator
(
TxSeq
era))) =>
ShelleyBasedEra
era
where
- shelleyBasedEraName :: proxy era -> Text
- applyShelleyBasedTx :: Globals -> LedgerEnv era -> MempoolState era -> WhetherToIntervene -> Tx era -> Except ( ApplyTxError era) ( MempoolState era, Validated ( Tx era))
- newtype WrapTx era = WrapTx { }
- type EraCrypto era = Crypto era
- data StandardCrypto
- data UnexpectedAlonzoLedgerErrors
Eras based on the Shelley ledger
type AllegraEra = ShelleyMAEra ' Allegra Source #
The Alonzo era
Instances
data BabbageEra c Source #
The Babbage era
Instances
type MaryEra c = ShelleyMAEra ' Mary c Source #
data ShelleyEra c Source #
Instances
Eras instantiated with standard crypto
type StandardAllegra = AllegraEra StandardCrypto Source #
The Allegra era with standard crypto
type StandardAlonzo = AlonzoEra StandardCrypto Source #
The Alonzo era with standard crypto
type StandardBabbage = BabbageEra StandardCrypto Source #
The Babbage era with standard crypto
type StandardMary = MaryEra StandardCrypto Source #
The Mary era with standard crypto
type StandardShelley = ShelleyEra StandardCrypto Source #
The Shelley era with standard crypto
Shelley-based era
class ( ShelleyBasedEra era, GetLedgerView era, State ( EraRule "PPUP" era) ~ PPUPState era, Default ( State ( EraRule "PPUP" era)), HasField "_maxBBSize" ( PParams era) Natural , HasField "_maxBHSize" ( PParams era) Natural , HasField "_maxTxSize" ( PParams era) Natural , HasField "_a0" ( PParams era) NonNegativeInterval , HasField "_nOpt" ( PParams era) Natural , HasField "_rho" ( PParams era) UnitInterval , HasField "_tau" ( PParams era) UnitInterval , ValidateScript era, FromCBOR ( PParams era), ToCBOR ( PParams era), HasField "_protocolVersion" ( PParamsDelta era) ( StrictMaybe ProtVer ), FromCBOR ( PParamsDelta era), AdditionalGenesisConfig era ~ TranslationContext era, ToCBORGroup ( TxSeq era), NoThunks ( TranslationContext era), FromCBOR ( Annotator ( Witnesses era)), ToCBOR ( Witnesses era), Eq ( TxSeq era), Show ( TxSeq era), FromCBOR ( Annotator ( TxSeq era))) => ShelleyBasedEra era where Source #
The ledger already defines
ShelleyBasedEra
as
the
top-level
constraint on an era, however, consensus often needs some more functionality
than the ledger currently provides.
Either the functionality shouldn't or can't live in the ledger, in which case
it can be part and remain part of
ShelleyBasedEra
. Or, the functionality
should
live in the ledger, but hasn't yet been added to the ledger, or it
hasn't yet been propagated to this repository, in which case it can be added
to this class until that is the case.
By having the same name as the class defined in ledger, we can, if this class becomes redundant, switch to the ledger-defined one without having to update all the code using it. We can just export the right one from this module.
TODO Currently we include some constraints on the update state which are needed to determine the hard fork point. In the future this should be replaced with an appropriate API - see https://github.com/input-output-hk/ouroboros-network/issues/2890
shelleyBasedEraName :: proxy era -> Text Source #
applyShelleyBasedTx :: Globals -> LedgerEnv era -> MempoolState era -> WhetherToIntervene -> Tx era -> Except ( ApplyTxError era) ( MempoolState era, Validated ( Tx era)) Source #
Instances
Wrapper for partially applying the
Tx
type family
For generality, Consensus uses that type family as eg the index of
TranslateEra
. We thus need to partially apply it.
cardano-ledger-specs
also declares such a newtype, but currently it's only
defined in the Alonzo translation module, which seems somewhat inappropriate
to use for previous eras. Also, we use a
Wrap
prefix in Consensus. Hence
this minor mediating definition. TODO I'm not even fully persuading myself
with this justification.
Instances
Type synonyms for convenience
Re-exports
data StandardCrypto Source #
The same crypto used on the net
Instances
Crypto StandardCrypto | |
Defined in Cardano.Ledger.Crypto type HASH StandardCrypto Source # type ADDRHASH StandardCrypto Source # type DSIGN StandardCrypto Source # type KES StandardCrypto Source # type VRF StandardCrypto Source # |
|
PraosCrypto StandardCrypto | |
Defined in Cardano.Protocol.TPraos.API |
|
PraosCrypto StandardCrypto | |
Defined in Ouroboros.Consensus.Protocol.Praos |
|
type VRF StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type KES StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type DSIGN StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type ADDRHASH StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
|
type HASH StandardCrypto | |
Defined in Cardano.Ledger.Crypto |
Exceptions
data UnexpectedAlonzoLedgerErrors Source #
The ledger responded with Alonzo errors we were not expecting