{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Cardano.Ledger.Shelley.PParams (
emptyShelleyPParams,
emptyShelleyPParamsUpdate,
ShelleyPParams (..),
emptyPParams,
HKD,
PPUpdateEnv (..),
ProposedPPUpdates (..),
emptyPPPUpdates,
Update (..),
upgradeUpdate,
pvCanFollow,
hasLegalProtVerUpdate,
shelleyPParams,
ppA0,
ppD,
ppEMax,
ppExtraEntropy,
ppMaxBBSize,
ppKeyDeposit,
ppMinFeeA,
ppMinFeeB,
ppMinPoolCost,
ppMaxBHSize,
ppMaxTxSize,
ppNOpt,
ppProtocolVersion,
ppPoolDeposit,
ppRho,
ppTau,
) where
import Cardano.Ledger.BaseTypes (
EpochInterval (..),
NonNegativeInterval,
Nonce (NeutralNonce),
ProtVer (..),
StrictMaybe (..),
UnitInterval,
succVersion,
)
import Cardano.Ledger.Binary (
DecCBOR (..),
EncCBOR (..),
FromCBOR (..),
ToCBOR (..),
encodeListLen,
)
import Cardano.Ledger.Binary.Coders (Decode (From, RecD), decode, (<!))
import Cardano.Ledger.Coin (Coin (..))
import Cardano.Ledger.Core
import Cardano.Ledger.HKD (HKD)
import Cardano.Ledger.Hashes (GenDelegs)
import Cardano.Ledger.Orphans ()
import Cardano.Ledger.Shelley.Era (ShelleyEra)
import Cardano.Ledger.Slot (EpochNo (..), SlotNo (..))
import Control.DeepSeq (NFData)
import Data.Aeson (
ToJSON (..),
)
import Data.Functor.Identity (Identity)
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Void
import Data.Word (Word16, Word32)
import GHC.Generics (Generic)
import Lens.Micro (lens, (^.))
import NoThunks.Class (NoThunks (..))
data ShelleyPParams f era = ShelleyPParams
{ forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinFeeA :: !(HKD f Coin)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinFeeB :: !(HKD f Coin)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word32
sppMaxBBSize :: !(HKD f Word32)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word32
sppMaxTxSize :: !(HKD f Word32)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word16
sppMaxBHSize :: !(HKD f Word16)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppKeyDeposit :: !(HKD f Coin)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppPoolDeposit :: !(HKD f Coin)
, forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f EpochInterval
sppEMax :: !(HKD f EpochInterval)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word16
sppNOpt :: !(HKD f Word16)
, forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f NonNegativeInterval
sppA0 :: !(HKD f NonNegativeInterval)
, forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppRho :: !(HKD f UnitInterval)
, forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppTau :: !(HKD f UnitInterval)
, forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppD :: !(HKD f UnitInterval)
, :: !(HKD f Nonce)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f ProtVer
sppProtocolVersion :: !(HKD f ProtVer)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinUTxOValue :: !(HKD f Coin)
, forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinPoolCost :: !(HKD f Coin)
}
deriving ((forall x. ShelleyPParams f era -> Rep (ShelleyPParams f era) x)
-> (forall x. Rep (ShelleyPParams f era) x -> ShelleyPParams f era)
-> Generic (ShelleyPParams f era)
forall x. Rep (ShelleyPParams f era) x -> ShelleyPParams f era
forall x. ShelleyPParams f era -> Rep (ShelleyPParams f era) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (f :: * -> *) era x.
Rep (ShelleyPParams f era) x -> ShelleyPParams f era
forall (f :: * -> *) era x.
ShelleyPParams f era -> Rep (ShelleyPParams f era) x
$cfrom :: forall (f :: * -> *) era x.
ShelleyPParams f era -> Rep (ShelleyPParams f era) x
from :: forall x. ShelleyPParams f era -> Rep (ShelleyPParams f era) x
$cto :: forall (f :: * -> *) era x.
Rep (ShelleyPParams f era) x -> ShelleyPParams f era
to :: forall x. Rep (ShelleyPParams f era) x -> ShelleyPParams f era
Generic)
deriving instance Eq (ShelleyPParams Identity era)
deriving instance Ord (ShelleyPParams Identity era)
deriving instance Show (ShelleyPParams Identity era)
instance NoThunks (ShelleyPParams Identity era)
instance NFData (ShelleyPParams Identity era)
deriving instance Eq (ShelleyPParams StrictMaybe era)
deriving instance Ord (ShelleyPParams StrictMaybe era)
deriving instance Show (ShelleyPParams StrictMaybe era)
instance NoThunks (ShelleyPParams StrictMaybe era)
instance NFData (ShelleyPParams StrictMaybe era)
instance EraPParams ShelleyEra where
type PParamsHKD f ShelleyEra = ShelleyPParams f ShelleyEra
type UpgradePParams f ShelleyEra = Void
type DowngradePParams f ShelleyEra = Void
emptyPParamsIdentity :: PParamsHKD Identity ShelleyEra
emptyPParamsIdentity = PParamsHKD Identity ShelleyEra
ShelleyPParams Identity ShelleyEra
forall era. Era era => ShelleyPParams Identity era
emptyShelleyPParams
emptyPParamsStrictMaybe :: PParamsHKD StrictMaybe ShelleyEra
emptyPParamsStrictMaybe = PParamsHKD StrictMaybe ShelleyEra
ShelleyPParams StrictMaybe ShelleyEra
forall era. ShelleyPParams StrictMaybe era
emptyShelleyPParamsUpdate
upgradePParamsHKD :: forall (f :: * -> *).
(HKDApplicative f, EraPParams (PreviousEra ShelleyEra)) =>
UpgradePParams f ShelleyEra
-> PParamsHKD f (PreviousEra ShelleyEra) -> PParamsHKD f ShelleyEra
upgradePParamsHKD = String
-> Void -> PParamsHKD f ByronEra -> ShelleyPParams f ShelleyEra
forall a. HasCallStack => String -> a
error String
"IMPOSSIBLE! There cannot be PParams that can be upgraded to Shelley"
downgradePParamsHKD :: forall (f :: * -> *).
(HKDFunctor f, EraPParams (PreviousEra ShelleyEra)) =>
DowngradePParams f ShelleyEra
-> PParamsHKD f ShelleyEra -> PParamsHKD f (PreviousEra ShelleyEra)
downgradePParamsHKD = String
-> Void -> ShelleyPParams f ShelleyEra -> PParamsHKD f ByronEra
forall a. HasCallStack => String -> a
error String
"IMPOSSIBLE! There cannot be PParams that can be downgraded from Shelley"
hkdMinFeeAL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdMinFeeAL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinFeeA ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppMinFeeA = x}
hkdMinFeeBL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdMinFeeBL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinFeeB ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppMinFeeB = x}
hkdMaxBBSizeL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Word32)
hkdMaxBBSizeL = (PParamsHKD f ShelleyEra -> HKD f Word32)
-> (PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Word32
ShelleyPParams f ShelleyEra -> HKD f Word32
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word32
sppMaxBBSize ((PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Word32
x -> PParamsHKD f ShelleyEra
pp {sppMaxBBSize = x}
hkdMaxTxSizeL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Word32)
hkdMaxTxSizeL = (PParamsHKD f ShelleyEra -> HKD f Word32)
-> (PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Word32
ShelleyPParams f ShelleyEra -> HKD f Word32
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word32
sppMaxTxSize ((PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Word32 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word32 -> f (HKD f Word32))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Word32
x -> PParamsHKD f ShelleyEra
pp {sppMaxTxSize = x}
hkdMaxBHSizeL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Word16)
hkdMaxBHSizeL = (PParamsHKD f ShelleyEra -> HKD f Word16)
-> (PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Word16
ShelleyPParams f ShelleyEra -> HKD f Word16
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word16
sppMaxBHSize ((PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Word16
x -> PParamsHKD f ShelleyEra
pp {sppMaxBHSize = x}
hkdKeyDepositL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdKeyDepositL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppKeyDeposit ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppKeyDeposit = x}
hkdPoolDepositL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdPoolDepositL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppPoolDeposit ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppPoolDeposit = x}
hkdEMaxL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f EpochInterval)
hkdEMaxL = (PParamsHKD f ShelleyEra -> HKD f EpochInterval)
-> (PParamsHKD f ShelleyEra
-> HKD f EpochInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f EpochInterval -> f (HKD f EpochInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f EpochInterval
ShelleyPParams f ShelleyEra -> HKD f EpochInterval
forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f EpochInterval
sppEMax ((PParamsHKD f ShelleyEra
-> HKD f EpochInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f EpochInterval -> f (HKD f EpochInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f EpochInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f EpochInterval -> f (HKD f EpochInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f EpochInterval
x -> PParamsHKD f ShelleyEra
pp {sppEMax = x}
hkdNOptL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Word16)
hkdNOptL = (PParamsHKD f ShelleyEra -> HKD f Word16)
-> (PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Word16
ShelleyPParams f ShelleyEra -> HKD f Word16
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Word16
sppNOpt ((PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Word16 -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Word16 -> f (HKD f Word16))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Word16
x -> PParamsHKD f ShelleyEra
pp {sppNOpt = x}
hkdA0L :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f NonNegativeInterval)
hkdA0L = (PParamsHKD f ShelleyEra -> HKD f NonNegativeInterval)
-> (PParamsHKD f ShelleyEra
-> HKD f NonNegativeInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f NonNegativeInterval -> f (HKD f NonNegativeInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f NonNegativeInterval
ShelleyPParams f ShelleyEra -> HKD f NonNegativeInterval
forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f NonNegativeInterval
sppA0 ((PParamsHKD f ShelleyEra
-> HKD f NonNegativeInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f NonNegativeInterval -> f (HKD f NonNegativeInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f NonNegativeInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f NonNegativeInterval -> f (HKD f NonNegativeInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f NonNegativeInterval
x -> PParamsHKD f ShelleyEra
pp {sppA0 = x}
hkdRhoL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f UnitInterval)
hkdRhoL = (PParamsHKD f ShelleyEra -> HKD f UnitInterval)
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f UnitInterval
ShelleyPParams f ShelleyEra -> HKD f UnitInterval
forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppRho ((PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f UnitInterval
x -> PParamsHKD f ShelleyEra
pp {sppRho = x}
hkdTauL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f UnitInterval)
hkdTauL = (PParamsHKD f ShelleyEra -> HKD f UnitInterval)
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f UnitInterval
ShelleyPParams f ShelleyEra -> HKD f UnitInterval
forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppTau ((PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f UnitInterval
x -> PParamsHKD f ShelleyEra
pp {sppTau = x}
hkdDL :: forall (f :: * -> *).
(HKDFunctor f, ProtVerAtMost ShelleyEra 6) =>
Lens' (PParamsHKD f ShelleyEra) (HKD f UnitInterval)
hkdDL = (PParamsHKD f ShelleyEra -> HKD f UnitInterval)
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f UnitInterval
ShelleyPParams f ShelleyEra -> HKD f UnitInterval
forall (f :: * -> *) era.
ShelleyPParams f era -> HKD f UnitInterval
sppD ((PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f UnitInterval -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f UnitInterval -> f (HKD f UnitInterval))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f UnitInterval
x -> PParamsHKD f ShelleyEra
pp {sppD = x}
hkdExtraEntropyL :: forall (f :: * -> *).
(HKDFunctor f, ProtVerAtMost ShelleyEra 6) =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Nonce)
hkdExtraEntropyL = (PParamsHKD f ShelleyEra -> HKD f Nonce)
-> (PParamsHKD f ShelleyEra
-> HKD f Nonce -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Nonce -> f (HKD f Nonce))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Nonce
ShelleyPParams f ShelleyEra -> HKD f Nonce
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Nonce
sppExtraEntropy ((PParamsHKD f ShelleyEra
-> HKD f Nonce -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Nonce -> f (HKD f Nonce))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Nonce -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Nonce -> f (HKD f Nonce))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Nonce
x -> PParamsHKD f ShelleyEra
pp {sppExtraEntropy = x}
hkdProtocolVersionL :: forall (f :: * -> *).
(HKDFunctor f, ProtVerAtMost ShelleyEra 8) =>
Lens' (PParamsHKD f ShelleyEra) (HKD f ProtVer)
hkdProtocolVersionL = (PParamsHKD f ShelleyEra -> HKD f ProtVer)
-> (PParamsHKD f ShelleyEra
-> HKD f ProtVer -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f ProtVer -> f (HKD f ProtVer))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f ProtVer
ShelleyPParams f ShelleyEra -> HKD f ProtVer
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f ProtVer
sppProtocolVersion ((PParamsHKD f ShelleyEra
-> HKD f ProtVer -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f ProtVer -> f (HKD f ProtVer))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f ProtVer -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f ProtVer -> f (HKD f ProtVer))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f ProtVer
x -> PParamsHKD f ShelleyEra
pp {sppProtocolVersion = x}
hkdMinUTxOValueL :: forall (f :: * -> *).
(HKDFunctor f, ProtVerAtMost ShelleyEra 4) =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdMinUTxOValueL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinUTxOValue ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppMinUTxOValue = x}
hkdMinPoolCostL :: forall (f :: * -> *).
HKDFunctor f =>
Lens' (PParamsHKD f ShelleyEra) (HKD f Coin)
hkdMinPoolCostL = (PParamsHKD f ShelleyEra -> HKD f Coin)
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens PParamsHKD f ShelleyEra -> HKD f Coin
ShelleyPParams f ShelleyEra -> HKD f Coin
forall (f :: * -> *) era. ShelleyPParams f era -> HKD f Coin
sppMinPoolCost ((PParamsHKD f ShelleyEra -> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra))
-> (PParamsHKD f ShelleyEra
-> HKD f Coin -> PParamsHKD f ShelleyEra)
-> forall {f :: * -> *}.
Functor f =>
(HKD f Coin -> f (HKD f Coin))
-> PParamsHKD f ShelleyEra -> f (PParamsHKD f ShelleyEra)
forall a b. (a -> b) -> a -> b
$ \PParamsHKD f ShelleyEra
pp HKD f Coin
x -> PParamsHKD f ShelleyEra
pp {sppMinPoolCost = x}
eraPParams :: [PParam ShelleyEra]
eraPParams = [PParam ShelleyEra]
forall era.
(EraPParams era, ProtVerAtMost era 4, ProtVerAtMost era 6,
ProtVerAtMost era 8) =>
[PParam era]
shelleyPParams
emptyShelleyPParams :: forall era. Era era => ShelleyPParams Identity era
emptyShelleyPParams :: forall era. Era era => ShelleyPParams Identity era
emptyShelleyPParams =
ShelleyPParams
{ sppMinFeeA :: HKD Identity Coin
sppMinFeeA = Integer -> Coin
Coin Integer
0
, sppMinFeeB :: HKD Identity Coin
sppMinFeeB = Integer -> Coin
Coin Integer
0
, sppMaxBBSize :: HKD Identity Word32
sppMaxBBSize = Word32
HKD Identity Word32
0
, sppMaxTxSize :: HKD Identity Word32
sppMaxTxSize = Word32
HKD Identity Word32
2048
, sppMaxBHSize :: HKD Identity Word16
sppMaxBHSize = Word16
HKD Identity Word16
0
, sppKeyDeposit :: HKD Identity Coin
sppKeyDeposit = Integer -> Coin
Coin Integer
0
, sppPoolDeposit :: HKD Identity Coin
sppPoolDeposit = Integer -> Coin
Coin Integer
0
, sppEMax :: HKD Identity EpochInterval
sppEMax = Word32 -> EpochInterval
EpochInterval Word32
0
, sppNOpt :: HKD Identity Word16
sppNOpt = Word16
HKD Identity Word16
100
, sppA0 :: HKD Identity NonNegativeInterval
sppA0 = HKD Identity NonNegativeInterval
NonNegativeInterval
forall a. Bounded a => a
minBound
, sppRho :: HKD Identity UnitInterval
sppRho = HKD Identity UnitInterval
UnitInterval
forall a. Bounded a => a
minBound
, sppTau :: HKD Identity UnitInterval
sppTau = HKD Identity UnitInterval
UnitInterval
forall a. Bounded a => a
minBound
, sppD :: HKD Identity UnitInterval
sppD = HKD Identity UnitInterval
UnitInterval
forall a. Bounded a => a
minBound
, sppExtraEntropy :: HKD Identity Nonce
sppExtraEntropy = HKD Identity Nonce
Nonce
NeutralNonce
, sppProtocolVersion :: HKD Identity ProtVer
sppProtocolVersion = Version -> Natural -> ProtVer
ProtVer (forall era. Era era => Version
eraProtVerLow @era) Natural
0
, sppMinUTxOValue :: HKD Identity Coin
sppMinUTxOValue = HKD Identity Coin
Coin
forall a. Monoid a => a
mempty
, sppMinPoolCost :: HKD Identity Coin
sppMinPoolCost = HKD Identity Coin
Coin
forall a. Monoid a => a
mempty
}
emptyShelleyPParamsUpdate :: ShelleyPParams StrictMaybe era
emptyShelleyPParamsUpdate :: forall era. ShelleyPParams StrictMaybe era
emptyShelleyPParamsUpdate =
ShelleyPParams
{ sppMinFeeA :: HKD StrictMaybe Coin
sppMinFeeA = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
, sppMinFeeB :: HKD StrictMaybe Coin
sppMinFeeB = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
, sppMaxBBSize :: HKD StrictMaybe Word32
sppMaxBBSize = StrictMaybe Word32
HKD StrictMaybe Word32
forall a. StrictMaybe a
SNothing
, sppMaxTxSize :: HKD StrictMaybe Word32
sppMaxTxSize = StrictMaybe Word32
HKD StrictMaybe Word32
forall a. StrictMaybe a
SNothing
, sppMaxBHSize :: HKD StrictMaybe Word16
sppMaxBHSize = StrictMaybe Word16
HKD StrictMaybe Word16
forall a. StrictMaybe a
SNothing
, sppKeyDeposit :: HKD StrictMaybe Coin
sppKeyDeposit = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
, sppPoolDeposit :: HKD StrictMaybe Coin
sppPoolDeposit = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
, sppEMax :: HKD StrictMaybe EpochInterval
sppEMax = StrictMaybe EpochInterval
HKD StrictMaybe EpochInterval
forall a. StrictMaybe a
SNothing
, sppNOpt :: HKD StrictMaybe Word16
sppNOpt = StrictMaybe Word16
HKD StrictMaybe Word16
forall a. StrictMaybe a
SNothing
, sppA0 :: HKD StrictMaybe NonNegativeInterval
sppA0 = StrictMaybe NonNegativeInterval
HKD StrictMaybe NonNegativeInterval
forall a. StrictMaybe a
SNothing
, sppRho :: HKD StrictMaybe UnitInterval
sppRho = StrictMaybe UnitInterval
HKD StrictMaybe UnitInterval
forall a. StrictMaybe a
SNothing
, sppTau :: HKD StrictMaybe UnitInterval
sppTau = StrictMaybe UnitInterval
HKD StrictMaybe UnitInterval
forall a. StrictMaybe a
SNothing
, sppD :: HKD StrictMaybe UnitInterval
sppD = StrictMaybe UnitInterval
HKD StrictMaybe UnitInterval
forall a. StrictMaybe a
SNothing
, sppExtraEntropy :: HKD StrictMaybe Nonce
sppExtraEntropy = StrictMaybe Nonce
HKD StrictMaybe Nonce
forall a. StrictMaybe a
SNothing
, sppProtocolVersion :: HKD StrictMaybe ProtVer
sppProtocolVersion = StrictMaybe ProtVer
HKD StrictMaybe ProtVer
forall a. StrictMaybe a
SNothing
, sppMinUTxOValue :: HKD StrictMaybe Coin
sppMinUTxOValue = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
, sppMinPoolCost :: HKD StrictMaybe Coin
sppMinPoolCost = StrictMaybe Coin
HKD StrictMaybe Coin
forall a. StrictMaybe a
SNothing
}
data Update era
= Update !(ProposedPPUpdates era) !EpochNo
deriving ((forall x. Update era -> Rep (Update era) x)
-> (forall x. Rep (Update era) x -> Update era)
-> Generic (Update era)
forall x. Rep (Update era) x -> Update era
forall x. Update era -> Rep (Update era) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall era x. Rep (Update era) x -> Update era
forall era x. Update era -> Rep (Update era) x
$cfrom :: forall era x. Update era -> Rep (Update era) x
from :: forall x. Update era -> Rep (Update era) x
$cto :: forall era x. Rep (Update era) x -> Update era
to :: forall x. Rep (Update era) x -> Update era
Generic)
deriving instance Eq (PParamsUpdate era) => Eq (Update era)
instance NFData (PParamsUpdate era) => NFData (Update era)
deriving instance Show (PParamsUpdate era) => Show (Update era)
instance NoThunks (PParamsUpdate era) => NoThunks (Update era)
instance (Era era, EncCBOR (PParamsUpdate era)) => EncCBOR (Update era) where
encCBOR :: Update era -> Encoding
encCBOR (Update ProposedPPUpdates era
ppUpdate EpochNo
e) =
Word -> Encoding
encodeListLen Word
2 Encoding -> Encoding -> Encoding
forall a. Semigroup a => a -> a -> a
<> ProposedPPUpdates era -> Encoding
forall a. EncCBOR a => a -> Encoding
encCBOR ProposedPPUpdates era
ppUpdate Encoding -> Encoding -> Encoding
forall a. Semigroup a => a -> a -> a
<> EpochNo -> Encoding
forall a. EncCBOR a => a -> Encoding
encCBOR EpochNo
e
instance
(Era era, DecCBOR (PParamsUpdate era)) =>
DecCBOR (Update era)
where
decCBOR :: forall s. Decoder s (Update era)
decCBOR = Decode ('Closed 'Dense) (Update era) -> Decoder s (Update era)
forall t (w :: Wrapped) s. Typeable t => Decode w t -> Decoder s t
decode (Decode ('Closed 'Dense) (Update era) -> Decoder s (Update era))
-> Decode ('Closed 'Dense) (Update era) -> Decoder s (Update era)
forall a b. (a -> b) -> a -> b
$ (ProposedPPUpdates era -> EpochNo -> Update era)
-> Decode
('Closed 'Dense) (ProposedPPUpdates era -> EpochNo -> Update era)
forall t. t -> Decode ('Closed 'Dense) t
RecD ProposedPPUpdates era -> EpochNo -> Update era
forall era. ProposedPPUpdates era -> EpochNo -> Update era
Update Decode
('Closed 'Dense) (ProposedPPUpdates era -> EpochNo -> Update era)
-> Decode ('Closed Any) (ProposedPPUpdates era)
-> Decode ('Closed 'Dense) (EpochNo -> Update era)
forall a (w1 :: Wrapped) t (w :: Density).
Typeable a =>
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! Decode ('Closed Any) (ProposedPPUpdates era)
forall t (w :: Wrapped). DecCBOR t => Decode w t
From Decode ('Closed 'Dense) (EpochNo -> Update era)
-> Decode ('Closed Any) EpochNo
-> Decode ('Closed 'Dense) (Update era)
forall a (w1 :: Wrapped) t (w :: Density).
Typeable a =>
Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
<! Decode ('Closed Any) EpochNo
forall t (w :: Wrapped). DecCBOR t => Decode w t
From
data PPUpdateEnv = PPUpdateEnv SlotNo GenDelegs
deriving (Int -> PPUpdateEnv -> ShowS
[PPUpdateEnv] -> ShowS
PPUpdateEnv -> String
(Int -> PPUpdateEnv -> ShowS)
-> (PPUpdateEnv -> String)
-> ([PPUpdateEnv] -> ShowS)
-> Show PPUpdateEnv
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PPUpdateEnv -> ShowS
showsPrec :: Int -> PPUpdateEnv -> ShowS
$cshow :: PPUpdateEnv -> String
show :: PPUpdateEnv -> String
$cshowList :: [PPUpdateEnv] -> ShowS
showList :: [PPUpdateEnv] -> ShowS
Show, PPUpdateEnv -> PPUpdateEnv -> Bool
(PPUpdateEnv -> PPUpdateEnv -> Bool)
-> (PPUpdateEnv -> PPUpdateEnv -> Bool) -> Eq PPUpdateEnv
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PPUpdateEnv -> PPUpdateEnv -> Bool
== :: PPUpdateEnv -> PPUpdateEnv -> Bool
$c/= :: PPUpdateEnv -> PPUpdateEnv -> Bool
/= :: PPUpdateEnv -> PPUpdateEnv -> Bool
Eq, (forall x. PPUpdateEnv -> Rep PPUpdateEnv x)
-> (forall x. Rep PPUpdateEnv x -> PPUpdateEnv)
-> Generic PPUpdateEnv
forall x. Rep PPUpdateEnv x -> PPUpdateEnv
forall x. PPUpdateEnv -> Rep PPUpdateEnv x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PPUpdateEnv -> Rep PPUpdateEnv x
from :: forall x. PPUpdateEnv -> Rep PPUpdateEnv x
$cto :: forall x. Rep PPUpdateEnv x -> PPUpdateEnv
to :: forall x. Rep PPUpdateEnv x -> PPUpdateEnv
Generic)
instance NoThunks PPUpdateEnv
{-# DEPRECATED PPUpdateEnv "As unused" #-}
newtype ProposedPPUpdates era
= ProposedPPUpdates (Map (KeyHash 'Genesis) (PParamsUpdate era))
deriving ((forall x. ProposedPPUpdates era -> Rep (ProposedPPUpdates era) x)
-> (forall x.
Rep (ProposedPPUpdates era) x -> ProposedPPUpdates era)
-> Generic (ProposedPPUpdates era)
forall x. Rep (ProposedPPUpdates era) x -> ProposedPPUpdates era
forall x. ProposedPPUpdates era -> Rep (ProposedPPUpdates era) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall era x.
Rep (ProposedPPUpdates era) x -> ProposedPPUpdates era
forall era x.
ProposedPPUpdates era -> Rep (ProposedPPUpdates era) x
$cfrom :: forall era x.
ProposedPPUpdates era -> Rep (ProposedPPUpdates era) x
from :: forall x. ProposedPPUpdates era -> Rep (ProposedPPUpdates era) x
$cto :: forall era x.
Rep (ProposedPPUpdates era) x -> ProposedPPUpdates era
to :: forall x. Rep (ProposedPPUpdates era) x -> ProposedPPUpdates era
Generic, NonEmpty (ProposedPPUpdates era) -> ProposedPPUpdates era
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
(ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era)
-> (NonEmpty (ProposedPPUpdates era) -> ProposedPPUpdates era)
-> (forall b.
Integral b =>
b -> ProposedPPUpdates era -> ProposedPPUpdates era)
-> Semigroup (ProposedPPUpdates era)
forall b.
Integral b =>
b -> ProposedPPUpdates era -> ProposedPPUpdates era
forall era.
NonEmpty (ProposedPPUpdates era) -> ProposedPPUpdates era
forall era.
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall era b.
Integral b =>
b -> ProposedPPUpdates era -> ProposedPPUpdates era
$c<> :: forall era.
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
<> :: ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
$csconcat :: forall era.
NonEmpty (ProposedPPUpdates era) -> ProposedPPUpdates era
sconcat :: NonEmpty (ProposedPPUpdates era) -> ProposedPPUpdates era
$cstimes :: forall era b.
Integral b =>
b -> ProposedPPUpdates era -> ProposedPPUpdates era
stimes :: forall b.
Integral b =>
b -> ProposedPPUpdates era -> ProposedPPUpdates era
Semigroup, Semigroup (ProposedPPUpdates era)
ProposedPPUpdates era
Semigroup (ProposedPPUpdates era) =>
ProposedPPUpdates era
-> (ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era)
-> ([ProposedPPUpdates era] -> ProposedPPUpdates era)
-> Monoid (ProposedPPUpdates era)
[ProposedPPUpdates era] -> ProposedPPUpdates era
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
forall era. Semigroup (ProposedPPUpdates era)
forall era. ProposedPPUpdates era
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall era. [ProposedPPUpdates era] -> ProposedPPUpdates era
forall era.
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
$cmempty :: forall era. ProposedPPUpdates era
mempty :: ProposedPPUpdates era
$cmappend :: forall era.
ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
mappend :: ProposedPPUpdates era
-> ProposedPPUpdates era -> ProposedPPUpdates era
$cmconcat :: forall era. [ProposedPPUpdates era] -> ProposedPPUpdates era
mconcat :: [ProposedPPUpdates era] -> ProposedPPUpdates era
Monoid)
deriving instance Eq (PParamsUpdate era) => Eq (ProposedPPUpdates era)
deriving instance NFData (PParamsUpdate era) => NFData (ProposedPPUpdates era)
deriving instance Show (PParamsUpdate era) => Show (ProposedPPUpdates era)
instance NoThunks (PParamsUpdate era) => NoThunks (ProposedPPUpdates era)
deriving instance (Era era, ToCBOR (PParamsUpdate era)) => ToCBOR (ProposedPPUpdates era)
deriving instance (Era era, FromCBOR (PParamsUpdate era)) => FromCBOR (ProposedPPUpdates era)
deriving instance (Era era, EncCBOR (PParamsUpdate era)) => EncCBOR (ProposedPPUpdates era)
deriving instance (Era era, DecCBOR (PParamsUpdate era)) => DecCBOR (ProposedPPUpdates era)
instance EraPParams era => ToJSON (ProposedPPUpdates era) where
toJSON :: ProposedPPUpdates era -> Value
toJSON (ProposedPPUpdates Map (KeyHash 'Genesis) (PParamsUpdate era)
ppUpdates) = [(KeyHash 'Genesis, PParamsUpdate era)] -> Value
forall a. ToJSON a => a -> Value
toJSON ([(KeyHash 'Genesis, PParamsUpdate era)] -> Value)
-> [(KeyHash 'Genesis, PParamsUpdate era)] -> Value
forall a b. (a -> b) -> a -> b
$ Map (KeyHash 'Genesis) (PParamsUpdate era)
-> [(KeyHash 'Genesis, PParamsUpdate era)]
forall k a. Map k a -> [(k, a)]
Map.toList Map (KeyHash 'Genesis) (PParamsUpdate era)
ppUpdates
toEncoding :: ProposedPPUpdates era -> Encoding
toEncoding (ProposedPPUpdates Map (KeyHash 'Genesis) (PParamsUpdate era)
ppUpdates) = [(KeyHash 'Genesis, PParamsUpdate era)] -> Encoding
forall a. ToJSON a => a -> Encoding
toEncoding ([(KeyHash 'Genesis, PParamsUpdate era)] -> Encoding)
-> [(KeyHash 'Genesis, PParamsUpdate era)] -> Encoding
forall a b. (a -> b) -> a -> b
$ Map (KeyHash 'Genesis) (PParamsUpdate era)
-> [(KeyHash 'Genesis, PParamsUpdate era)]
forall k a. Map k a -> [(k, a)]
Map.toList Map (KeyHash 'Genesis) (PParamsUpdate era)
ppUpdates
emptyPPPUpdates :: ProposedPPUpdates era
emptyPPPUpdates :: forall era. ProposedPPUpdates era
emptyPPPUpdates = Map (KeyHash 'Genesis) (PParamsUpdate era) -> ProposedPPUpdates era
forall era.
Map (KeyHash 'Genesis) (PParamsUpdate era) -> ProposedPPUpdates era
ProposedPPUpdates Map (KeyHash 'Genesis) (PParamsUpdate era)
forall k a. Map k a
Map.empty
pvCanFollow ::
ProtVer ->
ProtVer ->
Bool
pvCanFollow :: ProtVer -> ProtVer -> Bool
pvCanFollow (ProtVer Version
curMajor Natural
curMinor) (ProtVer Version
newMajor Natural
newMinor) =
(Version -> Maybe Version
forall (m :: * -> *). MonadFail m => Version -> m Version
succVersion Version
curMajor, Natural
0) (Maybe Version, Natural) -> (Maybe Version, Natural) -> Bool
forall a. Eq a => a -> a -> Bool
== (Version -> Maybe Version
forall a. a -> Maybe a
Just Version
newMajor, Natural
newMinor)
Bool -> Bool -> Bool
|| (Version
curMajor, Natural
curMinor Natural -> Natural -> Natural
forall a. Num a => a -> a -> a
+ Natural
1) (Version, Natural) -> (Version, Natural) -> Bool
forall a. Eq a => a -> a -> Bool
== (Version
newMajor, Natural
newMinor)
hasLegalProtVerUpdate ::
(ProtVerAtMost era 8, EraPParams era) => PParams era -> PParamsUpdate era -> Bool
hasLegalProtVerUpdate :: forall era.
(ProtVerAtMost era 8, EraPParams era) =>
PParams era -> PParamsUpdate era -> Bool
hasLegalProtVerUpdate PParams era
pp PParamsUpdate era
ppu =
case PParamsUpdate era
ppu PParamsUpdate era
-> Getting
(StrictMaybe ProtVer) (PParamsUpdate era) (StrictMaybe ProtVer)
-> StrictMaybe ProtVer
forall s a. s -> Getting a s a -> a
^. Getting
(StrictMaybe ProtVer) (PParamsUpdate era) (StrictMaybe ProtVer)
forall era.
(EraPParams era, ProtVerAtMost era 8) =>
Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
ppuProtocolVersionL of
StrictMaybe ProtVer
SNothing -> Bool
True
SJust ProtVer
newProtVer -> ProtVer -> ProtVer -> Bool
pvCanFollow (PParams era
pp PParams era -> Getting ProtVer (PParams era) ProtVer -> ProtVer
forall s a. s -> Getting a s a -> a
^. Getting ProtVer (PParams era) ProtVer
forall era. EraPParams era => Lens' (PParams era) ProtVer
Lens' (PParams era) ProtVer
ppProtocolVersionL) ProtVer
newProtVer
upgradeUpdate ::
forall era.
( EraPParams era
, EraPParams (PreviousEra era)
) =>
UpgradePParams StrictMaybe era ->
Update (PreviousEra era) ->
Update era
upgradeUpdate :: forall era.
(EraPParams era, EraPParams (PreviousEra era)) =>
UpgradePParams StrictMaybe era
-> Update (PreviousEra era) -> Update era
upgradeUpdate UpgradePParams StrictMaybe era
args (Update ProposedPPUpdates (PreviousEra era)
pp EpochNo
epoch) = ProposedPPUpdates era -> EpochNo -> Update era
forall era. ProposedPPUpdates era -> EpochNo -> Update era
Update (forall era.
(EraPParams era, EraPParams (PreviousEra era)) =>
UpgradePParams StrictMaybe era
-> ProposedPPUpdates (PreviousEra era) -> ProposedPPUpdates era
upgradeProposedPPUpdates @era UpgradePParams StrictMaybe era
args ProposedPPUpdates (PreviousEra era)
pp) EpochNo
epoch
upgradeProposedPPUpdates ::
( EraPParams era
, EraPParams (PreviousEra era)
) =>
UpgradePParams StrictMaybe era ->
ProposedPPUpdates (PreviousEra era) ->
ProposedPPUpdates era
upgradeProposedPPUpdates :: forall era.
(EraPParams era, EraPParams (PreviousEra era)) =>
UpgradePParams StrictMaybe era
-> ProposedPPUpdates (PreviousEra era) -> ProposedPPUpdates era
upgradeProposedPPUpdates UpgradePParams StrictMaybe era
args (ProposedPPUpdates Map (KeyHash 'Genesis) (PParamsUpdate (PreviousEra era))
ppus) =
Map (KeyHash 'Genesis) (PParamsUpdate era) -> ProposedPPUpdates era
forall era.
Map (KeyHash 'Genesis) (PParamsUpdate era) -> ProposedPPUpdates era
ProposedPPUpdates (Map (KeyHash 'Genesis) (PParamsUpdate era)
-> ProposedPPUpdates era)
-> Map (KeyHash 'Genesis) (PParamsUpdate era)
-> ProposedPPUpdates era
forall a b. (a -> b) -> a -> b
$ UpgradePParams StrictMaybe era
-> PParamsUpdate (PreviousEra era) -> PParamsUpdate era
forall era.
(EraPParams era, EraPParams (PreviousEra era)) =>
UpgradePParams StrictMaybe era
-> PParamsUpdate (PreviousEra era) -> PParamsUpdate era
upgradePParamsUpdate UpgradePParams StrictMaybe era
args (PParamsUpdate (PreviousEra era) -> PParamsUpdate era)
-> Map (KeyHash 'Genesis) (PParamsUpdate (PreviousEra era))
-> Map (KeyHash 'Genesis) (PParamsUpdate era)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Map (KeyHash 'Genesis) (PParamsUpdate (PreviousEra era))
ppus
ppMinFeeA :: EraPParams era => PParam era
ppMinFeeA :: forall era. EraPParams era => PParam era
ppMinFeeA =
PParam
{ ppName :: Text
ppName = Text
"txFeePerByte"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppMinFeeAL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
0 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuMinFeeAL
}
ppMinFeeB :: EraPParams era => PParam era
ppMinFeeB :: forall era. EraPParams era => PParam era
ppMinFeeB =
PParam
{ ppName :: Text
ppName = Text
"txFeeFixed"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppMinFeeBL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
1 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuMinFeeBL
}
ppMaxBBSize :: EraPParams era => PParam era
ppMaxBBSize :: forall era. EraPParams era => PParam era
ppMaxBBSize =
PParam
{ ppName :: Text
ppName = Text
"maxBlockBodySize"
, ppLens :: Lens' (PParams era) Word32
ppLens = (Word32 -> f Word32) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams era) Word32
ppMaxBBSizeL
, ppUpdate :: Maybe (PParamUpdate era Word32)
ppUpdate = PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32)
forall a. a -> Maybe a
Just (PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32))
-> PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Word32)
-> PParamUpdate era Word32
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
2 (StrictMaybe Word32 -> f (StrictMaybe Word32))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Word32)
Lens' (PParamsUpdate era) (StrictMaybe Word32)
ppuMaxBBSizeL
}
ppMaxTxSize :: EraPParams era => PParam era
ppMaxTxSize :: forall era. EraPParams era => PParam era
ppMaxTxSize =
PParam
{ ppName :: Text
ppName = Text
"maxTxSize"
, ppLens :: Lens' (PParams era) Word32
ppLens = (Word32 -> f Word32) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams era) Word32
ppMaxTxSizeL
, ppUpdate :: Maybe (PParamUpdate era Word32)
ppUpdate = PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32)
forall a. a -> Maybe a
Just (PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32))
-> PParamUpdate era Word32 -> Maybe (PParamUpdate era Word32)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Word32)
-> PParamUpdate era Word32
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
3 (StrictMaybe Word32 -> f (StrictMaybe Word32))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Word32)
Lens' (PParamsUpdate era) (StrictMaybe Word32)
ppuMaxTxSizeL
}
ppMaxBHSize :: EraPParams era => PParam era
ppMaxBHSize :: forall era. EraPParams era => PParam era
ppMaxBHSize =
PParam
{ ppName :: Text
ppName = Text
"maxBlockHeaderSize"
, ppLens :: Lens' (PParams era) Word16
ppLens = (Word16 -> f Word16) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams era) Word16
ppMaxBHSizeL
, ppUpdate :: Maybe (PParamUpdate era Word16)
ppUpdate = PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16)
forall a. a -> Maybe a
Just (PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16))
-> PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Word16)
-> PParamUpdate era Word16
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
4 (StrictMaybe Word16 -> f (StrictMaybe Word16))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Word16)
Lens' (PParamsUpdate era) (StrictMaybe Word16)
ppuMaxBHSizeL
}
ppKeyDeposit :: EraPParams era => PParam era
ppKeyDeposit :: forall era. EraPParams era => PParam era
ppKeyDeposit =
PParam
{ ppName :: Text
ppName = Text
"stakeAddressDeposit"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppKeyDepositL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
5 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuKeyDepositL
}
ppPoolDeposit :: EraPParams era => PParam era
ppPoolDeposit :: forall era. EraPParams era => PParam era
ppPoolDeposit =
PParam
{ ppName :: Text
ppName = Text
"stakePoolDeposit"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppPoolDepositL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
6 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuPoolDepositL
}
ppEMax :: EraPParams era => PParam era
ppEMax :: forall era. EraPParams era => PParam era
ppEMax =
PParam
{ ppName :: Text
ppName = Text
"poolRetireMaxEpoch"
, ppLens :: Lens' (PParams era) EpochInterval
ppLens = (EpochInterval -> f EpochInterval)
-> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) EpochInterval
Lens' (PParams era) EpochInterval
ppEMaxL
, ppUpdate :: Maybe (PParamUpdate era EpochInterval)
ppUpdate = PParamUpdate era EpochInterval
-> Maybe (PParamUpdate era EpochInterval)
forall a. a -> Maybe a
Just (PParamUpdate era EpochInterval
-> Maybe (PParamUpdate era EpochInterval))
-> PParamUpdate era EpochInterval
-> Maybe (PParamUpdate era EpochInterval)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe EpochInterval)
-> PParamUpdate era EpochInterval
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
7 (StrictMaybe EpochInterval -> f (StrictMaybe EpochInterval))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe EpochInterval)
Lens' (PParamsUpdate era) (StrictMaybe EpochInterval)
ppuEMaxL
}
ppNOpt :: EraPParams era => PParam era
ppNOpt :: forall era. EraPParams era => PParam era
ppNOpt =
PParam
{ ppName :: Text
ppName = Text
"stakePoolTargetNum"
, ppLens :: Lens' (PParams era) Word16
ppLens = (Word16 -> f Word16) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams era) Word16
ppNOptL
, ppUpdate :: Maybe (PParamUpdate era Word16)
ppUpdate = PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16)
forall a. a -> Maybe a
Just (PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16))
-> PParamUpdate era Word16 -> Maybe (PParamUpdate era Word16)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Word16)
-> PParamUpdate era Word16
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
8 (StrictMaybe Word16 -> f (StrictMaybe Word16))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Word16)
Lens' (PParamsUpdate era) (StrictMaybe Word16)
ppuNOptL
}
ppA0 :: EraPParams era => PParam era
ppA0 :: forall era. EraPParams era => PParam era
ppA0 =
PParam
{ ppName :: Text
ppName = Text
"poolPledgeInfluence"
, ppLens :: Lens' (PParams era) NonNegativeInterval
ppLens = (NonNegativeInterval -> f NonNegativeInterval)
-> PParams era -> f (PParams era)
forall era.
EraPParams era =>
Lens' (PParams era) NonNegativeInterval
Lens' (PParams era) NonNegativeInterval
ppA0L
, ppUpdate :: Maybe (PParamUpdate era NonNegativeInterval)
ppUpdate = PParamUpdate era NonNegativeInterval
-> Maybe (PParamUpdate era NonNegativeInterval)
forall a. a -> Maybe a
Just (PParamUpdate era NonNegativeInterval
-> Maybe (PParamUpdate era NonNegativeInterval))
-> PParamUpdate era NonNegativeInterval
-> Maybe (PParamUpdate era NonNegativeInterval)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe NonNegativeInterval)
-> PParamUpdate era NonNegativeInterval
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
9 (StrictMaybe NonNegativeInterval
-> f (StrictMaybe NonNegativeInterval))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe NonNegativeInterval)
Lens' (PParamsUpdate era) (StrictMaybe NonNegativeInterval)
ppuA0L
}
ppRho :: EraPParams era => PParam era
ppRho :: forall era. EraPParams era => PParam era
ppRho =
PParam
{ ppName :: Text
ppName = Text
"monetaryExpansion"
, ppLens :: Lens' (PParams era) UnitInterval
ppLens = (UnitInterval -> f UnitInterval) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) UnitInterval
Lens' (PParams era) UnitInterval
ppRhoL
, ppUpdate :: Maybe (PParamUpdate era UnitInterval)
ppUpdate = PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a. a -> Maybe a
Just (PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval))
-> PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
-> PParamUpdate era UnitInterval
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
10 (StrictMaybe UnitInterval -> f (StrictMaybe UnitInterval))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
ppuRhoL
}
ppTau :: EraPParams era => PParam era
ppTau :: forall era. EraPParams era => PParam era
ppTau =
PParam
{ ppName :: Text
ppName = Text
"treasuryCut"
, ppLens :: Lens' (PParams era) UnitInterval
ppLens = (UnitInterval -> f UnitInterval) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) UnitInterval
Lens' (PParams era) UnitInterval
ppTauL
, ppUpdate :: Maybe (PParamUpdate era UnitInterval)
ppUpdate = PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a. a -> Maybe a
Just (PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval))
-> PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
-> PParamUpdate era UnitInterval
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
11 (StrictMaybe UnitInterval -> f (StrictMaybe UnitInterval))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
ppuTauL
}
ppD :: (EraPParams era, ProtVerAtMost era 6) => PParam era
ppD :: forall era. (EraPParams era, ProtVerAtMost era 6) => PParam era
ppD =
PParam
{ ppName :: Text
ppName = Text
"decentralization"
, ppLens :: Lens' (PParams era) UnitInterval
ppLens = (UnitInterval -> f UnitInterval) -> PParams era -> f (PParams era)
forall era.
(EraPParams era, ProtVerAtMost era 6) =>
Lens' (PParams era) UnitInterval
Lens' (PParams era) UnitInterval
ppDL
, ppUpdate :: Maybe (PParamUpdate era UnitInterval)
ppUpdate = PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a. a -> Maybe a
Just (PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval))
-> PParamUpdate era UnitInterval
-> Maybe (PParamUpdate era UnitInterval)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
-> PParamUpdate era UnitInterval
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
12 (StrictMaybe UnitInterval -> f (StrictMaybe UnitInterval))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
(EraPParams era, ProtVerAtMost era 6) =>
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
Lens' (PParamsUpdate era) (StrictMaybe UnitInterval)
ppuDL
}
ppExtraEntropy :: (EraPParams era, ProtVerAtMost era 6) => PParam era
=
PParam
{ ppName :: Text
ppName = Text
"extraPraosEntropy"
, ppLens :: Lens' (PParams era) Nonce
ppLens = (Nonce -> f Nonce) -> PParams era -> f (PParams era)
forall era.
(EraPParams era, ProtVerAtMost era 6) =>
Lens' (PParams era) Nonce
Lens' (PParams era) Nonce
ppExtraEntropyL
, ppUpdate :: Maybe (PParamUpdate era Nonce)
ppUpdate = PParamUpdate era Nonce -> Maybe (PParamUpdate era Nonce)
forall a. a -> Maybe a
Just (PParamUpdate era Nonce -> Maybe (PParamUpdate era Nonce))
-> PParamUpdate era Nonce -> Maybe (PParamUpdate era Nonce)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Nonce)
-> PParamUpdate era Nonce
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
13 (StrictMaybe Nonce -> f (StrictMaybe Nonce))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
(EraPParams era, ProtVerAtMost era 6) =>
Lens' (PParamsUpdate era) (StrictMaybe Nonce)
Lens' (PParamsUpdate era) (StrictMaybe Nonce)
ppuExtraEntropyL
}
ppProtocolVersion :: (EraPParams era, ProtVerAtMost era 8) => PParam era
ppProtocolVersion :: forall era. (EraPParams era, ProtVerAtMost era 8) => PParam era
ppProtocolVersion =
PParam
{ ppName :: Text
ppName = Text
"protocolVersion"
, ppLens :: Lens' (PParams era) ProtVer
ppLens = (ProtVer -> f ProtVer) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) ProtVer
Lens' (PParams era) ProtVer
ppProtocolVersionL
, ppUpdate :: Maybe (PParamUpdate era ProtVer)
ppUpdate = PParamUpdate era ProtVer -> Maybe (PParamUpdate era ProtVer)
forall a. a -> Maybe a
Just (PParamUpdate era ProtVer -> Maybe (PParamUpdate era ProtVer))
-> PParamUpdate era ProtVer -> Maybe (PParamUpdate era ProtVer)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
-> PParamUpdate era ProtVer
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
14 (StrictMaybe ProtVer -> f (StrictMaybe ProtVer))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
(EraPParams era, ProtVerAtMost era 8) =>
Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
Lens' (PParamsUpdate era) (StrictMaybe ProtVer)
ppuProtocolVersionL
}
ppMinUTxOValue :: (EraPParams era, ProtVerAtMost era 4) => PParam era
ppMinUTxOValue :: forall era. (EraPParams era, ProtVerAtMost era 4) => PParam era
ppMinUTxOValue =
PParam
{ ppName :: Text
ppName = Text
"minUTxOValue"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era.
(EraPParams era, ProtVerAtMost era 4) =>
Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppMinUTxOValueL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
15 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
(EraPParams era, ProtVerAtMost era 4) =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuMinUTxOValueL
}
ppMinPoolCost :: EraPParams era => PParam era
ppMinPoolCost :: forall era. EraPParams era => PParam era
ppMinPoolCost =
PParam
{ ppName :: Text
ppName = Text
"minPoolCost"
, ppLens :: Lens' (PParams era) Coin
ppLens = (Coin -> f Coin) -> PParams era -> f (PParams era)
forall era. EraPParams era => Lens' (PParams era) Coin
Lens' (PParams era) Coin
ppMinPoolCostL
, ppUpdate :: Maybe (PParamUpdate era Coin)
ppUpdate = PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a. a -> Maybe a
Just (PParamUpdate era Coin -> Maybe (PParamUpdate era Coin))
-> PParamUpdate era Coin -> Maybe (PParamUpdate era Coin)
forall a b. (a -> b) -> a -> b
$ Word
-> Lens' (PParamsUpdate era) (StrictMaybe Coin)
-> PParamUpdate era Coin
forall era t.
Word
-> Lens' (PParamsUpdate era) (StrictMaybe t) -> PParamUpdate era t
PParamUpdate Word
16 (StrictMaybe Coin -> f (StrictMaybe Coin))
-> PParamsUpdate era -> f (PParamsUpdate era)
forall era.
EraPParams era =>
Lens' (PParamsUpdate era) (StrictMaybe Coin)
Lens' (PParamsUpdate era) (StrictMaybe Coin)
ppuMinPoolCostL
}
shelleyPParams ::
( EraPParams era
, ProtVerAtMost era 4
, ProtVerAtMost era 6
, ProtVerAtMost era 8
) =>
[PParam era]
shelleyPParams :: forall era.
(EraPParams era, ProtVerAtMost era 4, ProtVerAtMost era 6,
ProtVerAtMost era 8) =>
[PParam era]
shelleyPParams =
[ PParam era
forall era. EraPParams era => PParam era
ppMinFeeA
, PParam era
forall era. EraPParams era => PParam era
ppMinFeeB
, PParam era
forall era. EraPParams era => PParam era
ppMaxBBSize
, PParam era
forall era. EraPParams era => PParam era
ppMaxTxSize
, PParam era
forall era. EraPParams era => PParam era
ppMaxBHSize
, PParam era
forall era. EraPParams era => PParam era
ppKeyDeposit
, PParam era
forall era. EraPParams era => PParam era
ppPoolDeposit
, PParam era
forall era. EraPParams era => PParam era
ppEMax
, PParam era
forall era. EraPParams era => PParam era
ppNOpt
, PParam era
forall era. EraPParams era => PParam era
ppA0
, PParam era
forall era. EraPParams era => PParam era
ppRho
, PParam era
forall era. EraPParams era => PParam era
ppTau
, PParam era
forall era. (EraPParams era, ProtVerAtMost era 6) => PParam era
ppD
, PParam era
forall era. (EraPParams era, ProtVerAtMost era 6) => PParam era
ppExtraEntropy
, PParam era
forall era. (EraPParams era, ProtVerAtMost era 8) => PParam era
ppProtocolVersion
, PParam era
forall era. (EraPParams era, ProtVerAtMost era 4) => PParam era
ppMinUTxOValue
, PParam era
forall era. EraPParams era => PParam era
ppMinPoolCost
]