cardano-ledger-shelley-1.15.0.0: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.Transition

Description

Besides capturing all configuration that is necessary to progress to a specific era, this interface also provides fast forward functionality that is used in testing and benchmarking in order to initilize a chain in a particular era without going through the trouble of generating all the history for preceeding eras.

Synopsis

Documentation

class (EraTxOut era, EraGov era, EraGenesis era, ToJSON (TransitionConfig era), FromJSON (TransitionConfig era), Default (StashedAVVMAddresses era)) ⇒ EraTransition era where Source #

Associated Types

data TransitionConfig era ∷ Type Source #

Cumulative configuration that is needed to be able to start in a current era

Methods

mkTransitionConfig Source #

Arguments

TranslationContext era

Translation context necessary for advancing from previous era into the current one. This will usually be the contents of genesis file, if one exists for the current era

TransitionConfig (PreviousEra era)

Transition configuration for the previous era.

TransitionConfig era 

injectIntoTestState Source #

Arguments

TransitionConfig era

Extract data from the given transition configuration and store it in the given state.

Warning - Should only be used in testing and benchmarking. Will result in an error when NetworkId is set to Mainnet.

NewEpochState era 
NewEpochState era 

tcPreviousEraConfigLEraTransition (PreviousEra era) ⇒ Lens' (TransitionConfig era) (TransitionConfig (PreviousEra era)) Source #

In case when a previous era is available, we should always be able to access TransitionConfig for the previous era, from within the current era's TransitionConfig

tcTranslationContextLLens' (TransitionConfig era) (TranslationContext era) Source #

Lens for the TranslationContext for the current era from the TransitionConfig Translation context is a different name for the Genesis type for each era, they are one and the same concept.

tcShelleyGenesisLLens' (TransitionConfig era) (ShelleyGenesis (EraCrypto era)) Source #

Lens for the ShelleyGenesis from the TransitionConfig. Default implementation looks in the previous era's config

tcInitialPParamsGSimpleGetter (TransitionConfig era) (PParams era) Source #

Get the initial PParams for the current era from the TransitionConfig. Note that this is only useful for testing and fast forward functionality, because this function assumes no on-chain changes to PParams through PParamsUpdate functionality.

Default implementation will use the PParams from the Previous era and the current TranslationContext to construct PParams for the current era.

Warning - Should only be used in testing and benchmarking

tcInitialFundsL ∷ (HasCallStack, EraTransition era) ⇒ Lens' (TransitionConfig era) (ListMap (Addr (EraCrypto era)) Coin) Source #

Get the initial funds from the TransitionConfig. This value must be non-empty only during testing and benchmarking, it must never contain anything on a real system.

Warning - Should only be used in testing and benchmarking. Will result in an error when NetworkId is set to Mainnet

tcInitialStakingL ∷ (HasCallStack, EraTransition era) ⇒ Lens' (TransitionConfig era) (ShelleyGenesisStaking (EraCrypto era)) Source #

Get the initial staking from the TransitionConfig. This value must be non-empty only during testing and benchmarking, it must never contain anything on a real system.

Warning - Should only be used in testing and benchmarking. Will result in an error when NetworkId is set to Mainnet

createInitialState ∷ ∀ era. (EraTransition era, HasCallStack) ⇒ TransitionConfig era → NewEpochState era Source #

Helper function for constructing the initial state for any era

Warning - Should only be used in testing and benchmarking. Will result in an error when NetworkId is set to Mainnet

This function does not register any initial funds or delegates.

protectMainnet ∷ (HasCallStack, EraTransition era) ⇒ StringTransitionConfig era → (a → Bool) → a → a Source #