{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Cardano.Ledger.Mary.Forecast () where

import Cardano.Ledger.Mary.Era (MaryEra)
import Cardano.Ledger.Mary.PParams ()
import Cardano.Ledger.Mary.State.CertState ()
import Cardano.Ledger.Shelley (
  ShelleyForecast (..),
  mkShelleyForecast,
  sfDecentralizationL,
  sfExtraEntropyL,
  sfGenDelegsL,
  sfMaxBlockBodySizeL,
  sfMaxBlockHeaderSizeL,
  sfPoolDistrL,
  sfProtocolVersionL,
 )
import Cardano.Ledger.Shelley.API.Forecast (EraForecast (..), ShelleyEraForecast (..))

instance EraForecast MaryEra where
  type Forecast t MaryEra = ShelleyForecast t MaryEra
  mkForecast :: forall (t :: Timeline). NewEpochState MaryEra -> Forecast t MaryEra
mkForecast = NewEpochState MaryEra -> Forecast t MaryEra
NewEpochState MaryEra -> ShelleyForecast t MaryEra
forall era (t :: Timeline).
(AtMostEra "Alonzo" era, EraGov era, EraCertState era) =>
NewEpochState era -> ShelleyForecast t era
mkShelleyForecast
  poolDistrForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) PoolDistr
poolDistrForecastL = (PoolDistr -> f PoolDistr)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(PoolDistr -> f PoolDistr)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(PoolDistr -> f PoolDistr)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfPoolDistrL
  maxBlockHeaderSizeForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) Word16
maxBlockHeaderSizeForecastL = (Word16 -> f Word16)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(Word16 -> f Word16)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(Word16 -> f Word16)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfMaxBlockHeaderSizeL
  maxBlockBodySizeForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) Word32
maxBlockBodySizeForecastL = (Word32 -> f Word32)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(Word32 -> f Word32)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(Word32 -> f Word32)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfMaxBlockBodySizeL
  protocolVersionForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) ProtVer
protocolVersionForecastL = (ProtVer -> f ProtVer)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(ProtVer -> f ProtVer)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(ProtVer -> f ProtVer)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfProtocolVersionL

instance ShelleyEraForecast MaryEra where
  genDelegsForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) GenDelegs
genDelegsForecastL = (GenDelegs -> f GenDelegs)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(GenDelegs -> f GenDelegs)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(GenDelegs -> f GenDelegs)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfGenDelegsL
  decentralizationForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) UnitInterval
decentralizationForecastL = (UnitInterval -> f UnitInterval)
-> Forecast t MaryEra -> f (Forecast t MaryEra)
(UnitInterval -> f UnitInterval)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(UnitInterval -> f UnitInterval)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfDecentralizationL
  extraEntropyForecastL :: forall (t :: Timeline). Lens' (Forecast t MaryEra) Nonce
extraEntropyForecastL = (Nonce -> f Nonce) -> Forecast t MaryEra -> f (Forecast t MaryEra)
(Nonce -> f Nonce)
-> ShelleyForecast t MaryEra -> f (ShelleyForecast t MaryEra)
forall (t :: Timeline) era (f :: * -> *).
Functor f =>
(Nonce -> f Nonce)
-> ShelleyForecast t era -> f (ShelleyForecast t era)
sfExtraEntropyL