cardano-ledger-shelley-1.19.0.0: Shelley Ledger Executable Model
Safe HaskellNone
LanguageHaskell2010

Cardano.Ledger.Shelley.API.Forecast

Description

Forecast API for the consensus layer.

This module provides a type-safe interface for extracting protocol-relevant data from the ledger state, both for the current slot and for future slots within the stability window.

Synopsis

Core forecast class

class (STS (EraRule "TICKF" era), BaseM (EraRule "TICKF" era) ~ ShelleyBase, Environment (EraRule "TICKF" era) ~ (), State (EraRule "TICKF" era) ~ NewEpochState era, Signal (EraRule "TICKF" era) ~ SlotNo, PredicateFailure (EraRule "TICKF" era) ~ Void, EraGov era, EraCertState era) ⇒ EraForecast era where Source #

Core class for extracting forecast data from the ledger state.

Associated Types

type Forecast (t ∷ Timeline) era = (r ∷ Type) | r → t era Source #

Per-era forecast type.

data Timeline Source #

Type-level tag distinguishing current from future forecasts.

Constructors

Current 
Future 

TPraos-era extension (Shelley through Alonzo)

class (EraForecast era, AtMostEra "Alonzo" era) ⇒ ShelleyEraForecast era where Source #

Additional forecast fields available only in TPraos eras.

Main functions

currentForecastEraForecast era ⇒ NewEpochState era → Forecast 'Current era Source #

Extract the forecast for the current slot.

futureForecastEraForecast era ⇒ GlobalsSlotNoNewEpochState era → Forecast 'Future era Source #

TICKF a NewEpochState and then extract the forecast from it.

Conversion helpers

forecastChainChecks ∷ ∀ (t ∷ Timeline) era. EraForecast era ⇒ Forecast t era → ChainChecksPParams Source #

Construct ChainChecksPParams from any forecast.