{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Cardano.Rpc.Server.Internal.UtxoRpc.Type.ProtocolParameters
( protocolParamsToUtxoRpcPParams
, utxoRpcPParamsToProtocolParams
)
where
import Cardano.Api.Era
import Cardano.Api.Experimental.Era
import Cardano.Api.Ledger qualified as L
import Cardano.Api.Monad.Error
import Cardano.Rpc.Proto.Api.UtxoRpc.Query qualified as U5c
import Cardano.Rpc.Proto.Api.UtxoRpc.Query qualified as UtxoRpc
import Cardano.Rpc.Server.Internal.Orphans ()
import Cardano.Rpc.Server.Internal.UtxoRpc.Type.BigInt
import Cardano.Rpc.Server.Internal.UtxoRpc.Type.Rational
import Cardano.Ledger.Api qualified as L
import Cardano.Ledger.BaseTypes qualified as L
import Cardano.Ledger.Conway.Core qualified as L
import Cardano.Ledger.Conway.PParams qualified as L
import Cardano.Ledger.Plutus qualified as L
import RIO hiding (toList)
import Control.Error.Util (note)
import Data.Default
import Data.Map.Strict qualified as M
import GHC.IsList
import Network.GRPC.Spec
protocolParamsToUtxoRpcPParams
:: forall era
. Era era
-> L.PParams (LedgerEra era)
-> Proto UtxoRpc.PParams
protocolParamsToUtxoRpcPParams :: forall era. Era era -> PParams (LedgerEra era) -> Proto PParams
protocolParamsToUtxoRpcPParams Era era
era PParams (LedgerEra era)
pparams = Era era
-> (EraCommonConstraints era => Proto PParams) -> Proto PParams
forall era a. Era era -> (EraCommonConstraints era => a) -> a
obtainCommonConstraints Era era
era ((EraCommonConstraints era => Proto PParams) -> Proto PParams)
-> (EraCommonConstraints era => Proto PParams) -> Proto PParams
forall a b. (a -> b) -> a -> b
$ do
let Map Language [Int64]
pparamsCostModels :: Map L.Language [Int64] =
CostModel -> [Int64]
L.getCostModelParams (CostModel -> [Int64])
-> Map Language CostModel -> Map Language [Int64]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Map Language CostModel)
(PParams (LedgerEra era))
(Map Language CostModel)
-> Map Language CostModel
forall s a. s -> Getting a s a -> a
^. (CostModels -> Const (Map Language CostModel) CostModels)
-> PParams (LedgerEra era)
-> Const (Map Language CostModel) (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) CostModels
Lens' (PParams (LedgerEra era)) CostModels
L.ppCostModelsL ((CostModels -> Const (Map Language CostModel) CostModels)
-> PParams (LedgerEra era)
-> Const (Map Language CostModel) (PParams (LedgerEra era)))
-> ((Map Language CostModel
-> Const (Map Language CostModel) (Map Language CostModel))
-> CostModels -> Const (Map Language CostModel) CostModels)
-> Getting
(Map Language CostModel)
(PParams (LedgerEra era))
(Map Language CostModel)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CostModels -> Map Language CostModel)
-> SimpleGetter CostModels (Map Language CostModel)
forall s a. (s -> a) -> SimpleGetter s a
to CostModels -> Map Language CostModel
L.costModelsValid
PoolVotingThresholds
poolVotingThresholds :: L.PoolVotingThresholds =
PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
PoolVotingThresholds (PParams (LedgerEra era)) PoolVotingThresholds
-> PoolVotingThresholds
forall s a. s -> Getting a s a -> a
^. Getting
PoolVotingThresholds (PParams (LedgerEra era)) PoolVotingThresholds
forall era.
ConwayEraPParams era =>
Lens' (PParams era) PoolVotingThresholds
Lens' (PParams (LedgerEra era)) PoolVotingThresholds
L.ppPoolVotingThresholdsL
DRepVotingThresholds
drepVotingThresholds :: L.DRepVotingThresholds =
PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
DRepVotingThresholds (PParams (LedgerEra era)) DRepVotingThresholds
-> DRepVotingThresholds
forall s a. s -> Getting a s a -> a
^. Getting
DRepVotingThresholds (PParams (LedgerEra era)) DRepVotingThresholds
forall era.
ConwayEraPParams era =>
Lens' (PParams era) DRepVotingThresholds
Lens' (PParams (LedgerEra era)) DRepVotingThresholds
L.ppDRepVotingThresholdsL
Proto PParams
forall a. Default a => a
def
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "coinsPerUtxoByte" a) =>
LensLike' f s a
U5c.coinsPerUtxoByte
LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
BabbageEraPParams era =>
Lens' (PParams era) CoinPerByte
Lens' (PParams (LedgerEra era)) CoinPerByte
L.ppCoinsPerUTxOByteL ((CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CoinPerByte -> CompactForm Coin)
-> SimpleGetter CoinPerByte (CompactForm Coin)
forall s a. (s -> a) -> SimpleGetter s a
to CoinPerByte -> CompactForm Coin
L.unCoinPerByte Getting (Proto BigInt) CoinPerByte (CompactForm Coin)
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CompactForm Coin -> Const (Proto BigInt) (CompactForm Coin))
-> (Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CoinPerByte
-> Const (Proto BigInt) CoinPerByte
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CompactForm Coin -> Coin) -> SimpleGetter (CompactForm Coin) Coin
forall s a. (s -> a) -> SimpleGetter s a
to CompactForm Coin -> Coin
forall a. Compactible a => CompactForm a -> a
L.fromCompact Getting (Proto BigInt) (CompactForm Coin) Coin
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> (Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CompactForm Coin
-> Const (Proto BigInt) (CompactForm Coin)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxTxSize" a) =>
LensLike' f s a
U5c.maxTxSize LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams (LedgerEra era)) Word32
L.ppMaxTxSizeL ((Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeCoefficient" a) =>
LensLike' f s a
U5c.minFeeCoefficient
LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) CoinPerByte
Lens' (PParams (LedgerEra era)) CoinPerByte
L.ppTxFeePerByteL ((CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CoinPerByte -> Const (Proto BigInt) CoinPerByte)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CoinPerByte -> CompactForm Coin)
-> SimpleGetter CoinPerByte (CompactForm Coin)
forall s a. (s -> a) -> SimpleGetter s a
to CoinPerByte -> CompactForm Coin
L.unCoinPerByte Getting (Proto BigInt) CoinPerByte (CompactForm Coin)
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CompactForm Coin -> Const (Proto BigInt) (CompactForm Coin))
-> (Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CoinPerByte
-> Const (Proto BigInt) CoinPerByte
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (CompactForm Coin -> Coin) -> SimpleGetter (CompactForm Coin) Coin
forall s a. (s -> a) -> SimpleGetter s a
to CompactForm Coin -> Coin
forall a. Compactible a => CompactForm a -> a
L.fromCompact Getting (Proto BigInt) (CompactForm Coin) Coin
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> (Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> CompactForm Coin
-> Const (Proto BigInt) (CompactForm Coin)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeConstant" a) =>
LensLike' f s a
U5c.minFeeConstant LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
(EraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppTxFeeFixedL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxBlockBodySize" a) =>
LensLike' f s a
U5c.maxBlockBodySize LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams (LedgerEra era)) Word32
L.ppMaxBBSizeL ((Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxBlockHeaderSize" a) =>
LensLike' f s a
U5c.maxBlockHeaderSize LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams (LedgerEra era)) Word16
L.ppMaxBHSizeL ((Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word16 -> Const Word64 Word16)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word16 -> Word64) -> SimpleGetter Word16 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "stakeKeyDeposit" a) =>
LensLike' f s a
U5c.stakeKeyDeposit LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
(EraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppKeyDepositL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolDeposit" a) =>
LensLike' f s a
U5c.poolDeposit LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
(EraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppPoolDepositL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "poolRetirementEpochBound" a) =>
LensLike' f s a
U5c.poolRetirementEpochBound LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) EpochInterval
Lens' (PParams (LedgerEra era)) EpochInterval
L.ppEMaxL ((EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> EpochInterval -> Const Word64 EpochInterval)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EpochInterval -> Word32) -> SimpleGetter EpochInterval Word32
forall s a. (s -> a) -> SimpleGetter s a
to EpochInterval -> Word32
L.unEpochInterval Getting Word64 EpochInterval Word32
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> (Word64 -> Const Word64 Word64)
-> EpochInterval
-> Const Word64 EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "desiredNumberOfPools" a) =>
LensLike' f s a
U5c.desiredNumberOfPools LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams (LedgerEra era)) Word16
L.ppNOptL ((Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word16 -> Const Word64 Word16)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word16 -> Word64) -> SimpleGetter Word16 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolInfluence" a) =>
LensLike' f s a
U5c.poolInfluence LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era.
EraPParams era =>
Lens' (PParams era) NonNegativeInterval
Lens' (PParams (LedgerEra era)) NonNegativeInterval
L.ppA0L ((NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonNegativeInterval -> Ratio Integer)
-> SimpleGetter NonNegativeInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to NonNegativeInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) NonNegativeInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "monetaryExpansion" a) =>
LensLike' f s a
U5c.monetaryExpansion LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) UnitInterval
Lens' (PParams (LedgerEra era)) UnitInterval
L.ppRhoL ((UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UnitInterval -> Ratio Integer)
-> SimpleGetter UnitInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to UnitInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) UnitInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> UnitInterval
-> Const (Proto RationalNumber) UnitInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "treasuryExpansion" a) =>
LensLike' f s a
U5c.treasuryExpansion LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) UnitInterval
Lens' (PParams (LedgerEra era)) UnitInterval
L.ppTauL ((UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> UnitInterval -> Const (Proto RationalNumber) UnitInterval)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (UnitInterval -> Ratio Integer)
-> SimpleGetter UnitInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to UnitInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) UnitInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> UnitInterval
-> Const (Proto RationalNumber) UnitInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minPoolCost" a) =>
LensLike' f s a
U5c.minPoolCost LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
(EraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppMinPoolCostL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "protocolVersion" a) =>
LensLike' f s a
U5c.protocolVersion LensLike' Identity (Proto PParams) (Proto ProtocolVersion)
-> ((Word32 -> Identity Word32)
-> Proto ProtocolVersion -> Identity (Proto ProtocolVersion))
-> (Word32 -> Identity Word32)
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Identity Word32)
-> Proto ProtocolVersion -> Identity (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "major" a) =>
LensLike' f s a
U5c.major ((Word32 -> Identity Word32)
-> Proto PParams -> Identity (Proto PParams))
-> Word32 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word32 (PParams (LedgerEra era)) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. (ProtVer -> Const Word32 ProtVer)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) ProtVer
Lens' (PParams (LedgerEra era)) ProtVer
L.ppProtocolVersionL ((ProtVer -> Const Word32 ProtVer)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era)))
-> ((Word32 -> Const Word32 Word32)
-> ProtVer -> Const Word32 ProtVer)
-> Getting Word32 (PParams (LedgerEra era)) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ProtVer -> Version) -> SimpleGetter ProtVer Version
forall s a. (s -> a) -> SimpleGetter s a
to ProtVer -> Version
L.pvMajor Getting Word32 ProtVer Version
-> ((Word32 -> Const Word32 Word32)
-> Version -> Const Word32 Version)
-> (Word32 -> Const Word32 Word32)
-> ProtVer
-> Const Word32 ProtVer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Version -> Word32) -> SimpleGetter Version Word32
forall s a. (s -> a) -> SimpleGetter s a
to Version -> Word32
forall i. Integral i => Version -> i
L.getVersion
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "protocolVersion" a) =>
LensLike' f s a
U5c.protocolVersion LensLike' Identity (Proto PParams) (Proto ProtocolVersion)
-> ((Word32 -> Identity Word32)
-> Proto ProtocolVersion -> Identity (Proto ProtocolVersion))
-> (Word32 -> Identity Word32)
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Identity Word32)
-> Proto ProtocolVersion -> Identity (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "minor" a) =>
LensLike' f s a
U5c.minor ((Word32 -> Identity Word32)
-> Proto PParams -> Identity (Proto PParams))
-> Word32 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word32 (PParams (LedgerEra era)) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. (ProtVer -> Const Word32 ProtVer)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era))
forall era. EraPParams era => Lens' (PParams era) ProtVer
Lens' (PParams (LedgerEra era)) ProtVer
L.ppProtocolVersionL ((ProtVer -> Const Word32 ProtVer)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era)))
-> ((Word32 -> Const Word32 Word32)
-> ProtVer -> Const Word32 ProtVer)
-> Getting Word32 (PParams (LedgerEra era)) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ProtVer -> Natural) -> SimpleGetter ProtVer Natural
forall s a. (s -> a) -> SimpleGetter s a
to ProtVer -> Natural
L.pvMinor Getting Word32 ProtVer Natural
-> ((Word32 -> Const Word32 Word32)
-> Natural -> Const Word32 Natural)
-> (Word32 -> Const Word32 Word32)
-> ProtVer
-> Const Word32 ProtVer
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Natural -> Word32) -> SimpleGetter Natural Word32
forall s a. (s -> a) -> SimpleGetter s a
to Natural -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxValueSize" a) =>
LensLike' f s a
U5c.maxValueSize LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word32
Lens' (PParams (LedgerEra era)) Word32
L.ppMaxValSizeL ((Word32 -> Const Word64 Word32)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "collateralPercentage" a) =>
LensLike' f s a
U5c.collateralPercentage LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (LedgerEra era)) Word16
L.ppCollateralPercentageL ((Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word16 -> Const Word64 Word16)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word16 -> Word64) -> SimpleGetter Word16 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxCollateralInputs" a) =>
LensLike' f s a
U5c.maxCollateralInputs LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (LedgerEra era)) Word16
L.ppMaxCollateralInputsL ((Word16 -> Const Word64 Word16)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> Word16 -> Const Word64 Word16)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word16 -> Word64) -> SimpleGetter Word16 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto CostModels)
forall (f :: * -> *) s a.
(Functor f, HasField s "costModels" a) =>
LensLike' f s a
U5c.costModels LensLike' Identity (Proto PParams) (Proto CostModels)
-> (([Int64] -> Identity [Int64])
-> Proto CostModels -> Identity (Proto CostModels))
-> ([Int64] -> Identity [Int64])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' Identity (Proto CostModels) (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "plutusV1" a) =>
LensLike' f s a
U5c.plutusV1 LensLike' Identity (Proto CostModels) (Proto CostModel)
-> (([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel))
-> ([Int64] -> Identity [Int64])
-> Proto CostModels
-> Identity (Proto CostModels)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "values" a) =>
LensLike' f s a
U5c.values
(([Int64] -> Identity [Int64])
-> Proto PParams -> Identity (Proto PParams))
-> [Int64] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ([[Int64]] -> [Int64]
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join ([[Int64]] -> [Int64])
-> (Maybe [Int64] -> [[Int64]]) -> Maybe [Int64] -> [Int64]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe [Int64] -> [[Int64]]
forall a. Maybe a -> [a]
maybeToList) (Language -> Map Language [Int64] -> Maybe [Int64]
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Language
L.PlutusV1 Map Language [Int64]
pparamsCostModels)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto CostModels)
forall (f :: * -> *) s a.
(Functor f, HasField s "costModels" a) =>
LensLike' f s a
U5c.costModels LensLike' Identity (Proto PParams) (Proto CostModels)
-> (([Int64] -> Identity [Int64])
-> Proto CostModels -> Identity (Proto CostModels))
-> ([Int64] -> Identity [Int64])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' Identity (Proto CostModels) (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "plutusV2" a) =>
LensLike' f s a
U5c.plutusV2 LensLike' Identity (Proto CostModels) (Proto CostModel)
-> (([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel))
-> ([Int64] -> Identity [Int64])
-> Proto CostModels
-> Identity (Proto CostModels)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "values" a) =>
LensLike' f s a
U5c.values
(([Int64] -> Identity [Int64])
-> Proto PParams -> Identity (Proto PParams))
-> [Int64] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ([[Int64]] -> [Int64]
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join ([[Int64]] -> [Int64])
-> (Maybe [Int64] -> [[Int64]]) -> Maybe [Int64] -> [Int64]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe [Int64] -> [[Int64]]
forall a. Maybe a -> [a]
maybeToList) (Language -> Map Language [Int64] -> Maybe [Int64]
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Language
L.PlutusV2 Map Language [Int64]
pparamsCostModels)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto CostModels)
forall (f :: * -> *) s a.
(Functor f, HasField s "costModels" a) =>
LensLike' f s a
U5c.costModels LensLike' Identity (Proto PParams) (Proto CostModels)
-> (([Int64] -> Identity [Int64])
-> Proto CostModels -> Identity (Proto CostModels))
-> ([Int64] -> Identity [Int64])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' Identity (Proto CostModels) (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "plutusV3" a) =>
LensLike' f s a
U5c.plutusV3 LensLike' Identity (Proto CostModels) (Proto CostModel)
-> (([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel))
-> ([Int64] -> Identity [Int64])
-> Proto CostModels
-> Identity (Proto CostModels)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "values" a) =>
LensLike' f s a
U5c.values
(([Int64] -> Identity [Int64])
-> Proto PParams -> Identity (Proto PParams))
-> [Int64] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ([[Int64]] -> [Int64]
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join ([[Int64]] -> [Int64])
-> (Maybe [Int64] -> [[Int64]]) -> Maybe [Int64] -> [Int64]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe [Int64] -> [[Int64]]
forall a. Maybe a -> [a]
maybeToList) (Language -> Map Language [Int64] -> Maybe [Int64]
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Language
L.PlutusV3 Map Language [Int64]
pparamsCostModels)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto CostModels)
forall (f :: * -> *) s a.
(Functor f, HasField s "costModels" a) =>
LensLike' f s a
U5c.costModels LensLike' Identity (Proto PParams) (Proto CostModels)
-> (([Int64] -> Identity [Int64])
-> Proto CostModels -> Identity (Proto CostModels))
-> ([Int64] -> Identity [Int64])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' Identity (Proto CostModels) (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "plutusV4" a) =>
LensLike' f s a
U5c.plutusV4 LensLike' Identity (Proto CostModels) (Proto CostModel)
-> (([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel))
-> ([Int64] -> Identity [Int64])
-> Proto CostModels
-> Identity (Proto CostModels)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int64] -> Identity [Int64])
-> Proto CostModel -> Identity (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "values" a) =>
LensLike' f s a
U5c.values
(([Int64] -> Identity [Int64])
-> Proto PParams -> Identity (Proto PParams))
-> [Int64] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ([[Int64]] -> [Int64]
forall (m :: * -> *) a. Monad m => m (m a) -> m a
join ([[Int64]] -> [Int64])
-> (Maybe [Int64] -> [[Int64]]) -> Maybe [Int64] -> [Int64]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe [Int64] -> [[Int64]]
forall a. Maybe a -> [a]
maybeToList) (Language -> Map Language [Int64] -> Maybe [Int64]
forall k a. Ord k => k -> Map k a -> Maybe a
M.lookup Language
L.PlutusV4 Map Language [Int64]
pparamsCostModels)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ExPrices)
forall (f :: * -> *) s a.
(Functor f, HasField s "prices" a) =>
LensLike' f s a
U5c.prices LensLike' Identity (Proto PParams) (Proto ExPrices)
-> ((Proto RationalNumber -> Identity (Proto RationalNumber))
-> Proto ExPrices -> Identity (Proto ExPrices))
-> LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Identity (Proto RationalNumber))
-> Proto ExPrices -> Identity (Proto ExPrices)
forall (f :: * -> *) s a.
(Functor f, HasField s "steps" a) =>
LensLike' f s a
U5c.steps LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (Prices -> Const (Proto RationalNumber) Prices)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Prices
Lens' (PParams (LedgerEra era)) Prices
L.ppPricesL ((Prices -> Const (Proto RationalNumber) Prices)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Prices -> Const (Proto RationalNumber) Prices)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Prices -> NonNegativeInterval)
-> SimpleGetter Prices NonNegativeInterval
forall s a. (s -> a) -> SimpleGetter s a
to Prices -> NonNegativeInterval
L.prSteps Getting (Proto RationalNumber) Prices NonNegativeInterval
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Prices
-> Const (Proto RationalNumber) Prices
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonNegativeInterval -> Ratio Integer)
-> SimpleGetter NonNegativeInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to NonNegativeInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) NonNegativeInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ExPrices)
forall (f :: * -> *) s a.
(Functor f, HasField s "prices" a) =>
LensLike' f s a
U5c.prices LensLike' Identity (Proto PParams) (Proto ExPrices)
-> ((Proto RationalNumber -> Identity (Proto RationalNumber))
-> Proto ExPrices -> Identity (Proto ExPrices))
-> LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Identity (Proto RationalNumber))
-> Proto ExPrices -> Identity (Proto ExPrices)
forall (f :: * -> *) s a.
(Functor f, HasField s "memory" a) =>
LensLike' f s a
U5c.memory LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (Prices -> Const (Proto RationalNumber) Prices)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Prices
Lens' (PParams (LedgerEra era)) Prices
L.ppPricesL ((Prices -> Const (Proto RationalNumber) Prices)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Prices -> Const (Proto RationalNumber) Prices)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Prices -> NonNegativeInterval)
-> SimpleGetter Prices NonNegativeInterval
forall s a. (s -> a) -> SimpleGetter s a
to Prices -> NonNegativeInterval
L.prMem Getting (Proto RationalNumber) Prices NonNegativeInterval
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Prices
-> Const (Proto RationalNumber) Prices
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonNegativeInterval -> Ratio Integer)
-> SimpleGetter NonNegativeInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to NonNegativeInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) NonNegativeInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ExUnits)
forall (f :: * -> *) s a.
(Functor f, HasField s "maxExecutionUnitsPerTransaction" a) =>
LensLike' f s a
U5c.maxExecutionUnitsPerTransaction LensLike' Identity (Proto PParams) (Proto ExUnits)
-> Proto ExUnits -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto ExUnits) (PParams (LedgerEra era)) (Proto ExUnits)
-> Proto ExUnits
forall s a. s -> Getting a s a -> a
^. (ExUnits -> Const (Proto ExUnits) ExUnits)
-> PParams (LedgerEra era)
-> Const (Proto ExUnits) (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) ExUnits
Lens' (PParams (LedgerEra era)) ExUnits
L.ppMaxTxExUnitsL ((ExUnits -> Const (Proto ExUnits) ExUnits)
-> PParams (LedgerEra era)
-> Const (Proto ExUnits) (PParams (LedgerEra era)))
-> ((Proto ExUnits -> Const (Proto ExUnits) (Proto ExUnits))
-> ExUnits -> Const (Proto ExUnits) ExUnits)
-> Getting
(Proto ExUnits) (PParams (LedgerEra era)) (Proto ExUnits)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ExUnits -> Proto ExUnits) -> SimpleGetter ExUnits (Proto ExUnits)
forall s a. (s -> a) -> SimpleGetter s a
to ExUnits -> Proto ExUnits
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto ExUnits)
forall (f :: * -> *) s a.
(Functor f, HasField s "maxExecutionUnitsPerBlock" a) =>
LensLike' f s a
U5c.maxExecutionUnitsPerBlock LensLike' Identity (Proto PParams) (Proto ExUnits)
-> Proto ExUnits -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto ExUnits) (PParams (LedgerEra era)) (Proto ExUnits)
-> Proto ExUnits
forall s a. s -> Getting a s a -> a
^. (ExUnits -> Const (Proto ExUnits) ExUnits)
-> PParams (LedgerEra era)
-> Const (Proto ExUnits) (PParams (LedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) ExUnits
Lens' (PParams (LedgerEra era)) ExUnits
L.ppMaxBlockExUnitsL ((ExUnits -> Const (Proto ExUnits) ExUnits)
-> PParams (LedgerEra era)
-> Const (Proto ExUnits) (PParams (LedgerEra era)))
-> ((Proto ExUnits -> Const (Proto ExUnits) (Proto ExUnits))
-> ExUnits -> Const (Proto ExUnits) ExUnits)
-> Getting
(Proto ExUnits) (PParams (LedgerEra era)) (Proto ExUnits)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ExUnits -> Proto ExUnits) -> SimpleGetter ExUnits (Proto ExUnits)
forall s a. (s -> a) -> SimpleGetter s a
to ExUnits -> Proto ExUnits
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeScriptRefCostPerByte" a) =>
LensLike' f s a
U5c.minFeeScriptRefCostPerByte
LensLike' Identity (Proto PParams) (Proto RationalNumber)
-> Proto RationalNumber -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
-> Proto RationalNumber
forall s a. s -> Getting a s a -> a
^. (NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) NonNegativeInterval
Lens' (PParams (LedgerEra era)) NonNegativeInterval
L.ppMinFeeRefScriptCostPerByteL ((NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> PParams (LedgerEra era)
-> Const (Proto RationalNumber) (PParams (LedgerEra era)))
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval)
-> Getting
(Proto RationalNumber)
(PParams (LedgerEra era))
(Proto RationalNumber)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (NonNegativeInterval -> Ratio Integer)
-> SimpleGetter NonNegativeInterval (Ratio Integer)
forall s a. (s -> a) -> SimpleGetter s a
to NonNegativeInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational Getting (Proto RationalNumber) NonNegativeInterval (Ratio Integer)
-> ((Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> Ratio Integer -> Const (Proto RationalNumber) (Ratio Integer))
-> (Proto RationalNumber
-> Const (Proto RationalNumber) (Proto RationalNumber))
-> NonNegativeInterval
-> Const (Proto RationalNumber) NonNegativeInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ratio Integer -> Proto RationalNumber)
-> SimpleGetter (Ratio Integer) (Proto RationalNumber)
forall s a. (s -> a) -> SimpleGetter s a
to Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolVotingThresholds" a) =>
LensLike' f s a
U5c.poolVotingThresholds LensLike' Identity (Proto PParams) (Proto VotingThresholds)
-> (([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto VotingThresholds -> Identity (Proto VotingThresholds))
-> ([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto VotingThresholds -> Identity (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "thresholds" a) =>
LensLike' f s a
U5c.thresholds
(([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto PParams -> Identity (Proto PParams))
-> [Proto RationalNumber] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ( Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject (Ratio Integer -> Proto RationalNumber)
-> (UnitInterval -> Ratio Integer)
-> UnitInterval
-> Proto RationalNumber
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnitInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational
(UnitInterval -> Proto RationalNumber)
-> [UnitInterval] -> [Proto RationalNumber]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [ PoolVotingThresholds
poolVotingThresholds PoolVotingThresholds
-> Getting UnitInterval PoolVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval PoolVotingThresholds UnitInterval
Lens' PoolVotingThresholds UnitInterval
L.pvtMotionNoConfidenceL
, PoolVotingThresholds
poolVotingThresholds PoolVotingThresholds
-> Getting UnitInterval PoolVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval PoolVotingThresholds UnitInterval
Lens' PoolVotingThresholds UnitInterval
L.pvtCommitteeNormalL
, PoolVotingThresholds
poolVotingThresholds PoolVotingThresholds
-> Getting UnitInterval PoolVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval PoolVotingThresholds UnitInterval
Lens' PoolVotingThresholds UnitInterval
L.pvtCommitteeNoConfidenceL
, PoolVotingThresholds
poolVotingThresholds PoolVotingThresholds
-> Getting UnitInterval PoolVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval PoolVotingThresholds UnitInterval
Lens' PoolVotingThresholds UnitInterval
L.pvtHardForkInitiationL
, PoolVotingThresholds
poolVotingThresholds PoolVotingThresholds
-> Getting UnitInterval PoolVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval PoolVotingThresholds UnitInterval
Lens' PoolVotingThresholds UnitInterval
L.pvtPPSecurityGroupL
]
)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "drepVotingThresholds" a) =>
LensLike' f s a
U5c.drepVotingThresholds LensLike' Identity (Proto PParams) (Proto VotingThresholds)
-> (([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto VotingThresholds -> Identity (Proto VotingThresholds))
-> ([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto PParams
-> Identity (Proto PParams)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto VotingThresholds -> Identity (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "thresholds" a) =>
LensLike' f s a
U5c.thresholds
(([Proto RationalNumber] -> Identity [Proto RationalNumber])
-> Proto PParams -> Identity (Proto PParams))
-> [Proto RationalNumber] -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ( Ratio Integer -> Proto RationalNumber
forall t s. Inject t s => t -> s
inject (Ratio Integer -> Proto RationalNumber)
-> (UnitInterval -> Ratio Integer)
-> UnitInterval
-> Proto RationalNumber
forall b c a. (b -> c) -> (a -> b) -> a -> c
. UnitInterval -> Ratio Integer
forall r. BoundedRational r => r -> Ratio Integer
L.unboundRational
(UnitInterval -> Proto RationalNumber)
-> [UnitInterval] -> [Proto RationalNumber]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [ DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtMotionNoConfidenceL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtCommitteeNormalL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtCommitteeNoConfidenceL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtUpdateToConstitutionL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtHardForkInitiationL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtPPNetworkGroupL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtPPEconomicGroupL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtPPTechnicalGroupL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtPPGovGroupL
, DRepVotingThresholds
drepVotingThresholds DRepVotingThresholds
-> Getting UnitInterval DRepVotingThresholds UnitInterval
-> UnitInterval
forall s a. s -> Getting a s a -> a
^. Getting UnitInterval DRepVotingThresholds UnitInterval
Lens' DRepVotingThresholds UnitInterval
L.dvtTreasuryWithdrawalL
]
)
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& (Word32 -> Identity Word32)
-> Proto PParams -> Identity (Proto PParams)
forall (f :: * -> *) s a.
(Functor f, HasField s "minCommitteeSize" a) =>
LensLike' f s a
U5c.minCommitteeSize ((Word32 -> Identity Word32)
-> Proto PParams -> Identity (Proto PParams))
-> Word32 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word32 (PParams (LedgerEra era)) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. (Word16 -> Const Word32 Word16)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era))
forall era. ConwayEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (LedgerEra era)) Word16
L.ppCommitteeMinSizeL ((Word16 -> Const Word32 Word16)
-> PParams (LedgerEra era)
-> Const Word32 (PParams (LedgerEra era)))
-> ((Word32 -> Const Word32 Word32)
-> Word16 -> Const Word32 Word16)
-> Getting Word32 (PParams (LedgerEra era)) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word16 -> Word32) -> SimpleGetter Word16 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word16 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "committeeTermLimit" a) =>
LensLike' f s a
U5c.committeeTermLimit
LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (LedgerEra era)) EpochInterval
L.ppCommitteeMaxTermLengthL ((EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> EpochInterval -> Const Word64 EpochInterval)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EpochInterval -> Word32) -> SimpleGetter EpochInterval Word32
forall s a. (s -> a) -> SimpleGetter s a
to EpochInterval -> Word32
L.unEpochInterval Getting Word64 EpochInterval Word32
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> (Word64 -> Const Word64 Word64)
-> EpochInterval
-> Const Word64 EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "governanceActionValidityPeriod" a) =>
LensLike' f s a
U5c.governanceActionValidityPeriod
LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (LedgerEra era)) EpochInterval
L.ppGovActionLifetimeL ((EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> EpochInterval -> Const Word64 EpochInterval)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EpochInterval -> Word32) -> SimpleGetter EpochInterval Word32
forall s a. (s -> a) -> SimpleGetter s a
to EpochInterval -> Word32
L.unEpochInterval Getting Word64 EpochInterval Word32
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> (Word64 -> Const Word64 Word64)
-> EpochInterval
-> Const Word64 EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "governanceActionDeposit" a) =>
LensLike' f s a
U5c.governanceActionDeposit LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era.
(ConwayEraPParams era, HasCallStack) =>
Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppGovActionDepositL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "drepDeposit" a) =>
LensLike' f s a
U5c.drepDeposit LensLike' Identity (Proto PParams) (Proto BigInt)
-> Proto BigInt -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
-> Proto BigInt
forall s a. s -> Getting a s a -> a
^. (Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era))
forall era. ConwayEraPParams era => Lens' (PParams era) Coin
Lens' (PParams (LedgerEra era)) Coin
L.ppDRepDepositL ((Coin -> Const (Proto BigInt) Coin)
-> PParams (LedgerEra era)
-> Const (Proto BigInt) (PParams (LedgerEra era)))
-> ((Proto BigInt -> Const (Proto BigInt) (Proto BigInt))
-> Coin -> Const (Proto BigInt) Coin)
-> Getting (Proto BigInt) (PParams (LedgerEra era)) (Proto BigInt)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Coin -> Proto BigInt) -> SimpleGetter Coin (Proto BigInt)
forall s a. (s -> a) -> SimpleGetter s a
to Coin -> Proto BigInt
forall t s. Inject t s => t -> s
inject
Proto PParams -> (Proto PParams -> Proto PParams) -> Proto PParams
forall a b. a -> (a -> b) -> b
& LensLike' Identity (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "drepInactivityPeriod" a) =>
LensLike' f s a
U5c.drepInactivityPeriod LensLike' Identity (Proto PParams) Word64
-> Word64 -> Proto PParams -> Proto PParams
forall s t a b. ASetter s t a b -> b -> s -> t
.~ PParams (LedgerEra era)
pparams PParams (LedgerEra era)
-> Getting Word64 (PParams (LedgerEra era)) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. (EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (LedgerEra era)) EpochInterval
L.ppDRepActivityL ((EpochInterval -> Const Word64 EpochInterval)
-> PParams (LedgerEra era)
-> Const Word64 (PParams (LedgerEra era)))
-> ((Word64 -> Const Word64 Word64)
-> EpochInterval -> Const Word64 EpochInterval)
-> Getting Word64 (PParams (LedgerEra era)) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (EpochInterval -> Word32) -> SimpleGetter EpochInterval Word32
forall s a. (s -> a) -> SimpleGetter s a
to EpochInterval -> Word32
L.unEpochInterval Getting Word64 EpochInterval Word32
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> (Word64 -> Const Word64 Word64)
-> EpochInterval
-> Const Word64 EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
utxoRpcPParamsToProtocolParams
:: Era era
-> Proto UtxoRpc.PParams
-> Either String (L.PParams (ShelleyLedgerEra era))
utxoRpcPParamsToProtocolParams :: forall era.
Era era
-> Proto PParams -> Either String (PParams (ShelleyLedgerEra era))
utxoRpcPParamsToProtocolParams Era era
era Proto PParams
pp = ConwayEraOnwards era
-> (ConwayEraOnwardsConstraints era =>
Either String (PParams (ShelleyLedgerEra era)))
-> Either String (PParams (ShelleyLedgerEra era))
forall era a.
ConwayEraOnwards era -> (ConwayEraOnwardsConstraints era => a) -> a
conwayEraOnwardsConstraints (Era era -> ConwayEraOnwards era
forall era. Era era -> ConwayEraOnwards era
forall a (f :: a -> *) (g :: a -> *) (era :: a).
Convert f g =>
f era -> g era
convert Era era
era) ((ConwayEraOnwardsConstraints era =>
Either String (PParams (ShelleyLedgerEra era)))
-> Either String (PParams (ShelleyLedgerEra era)))
-> (ConwayEraOnwardsConstraints era =>
Either String (PParams (ShelleyLedgerEra era)))
-> Either String (PParams (ShelleyLedgerEra era))
forall a b. (a -> b) -> a -> b
$ do
PParams (ShelleyLedgerEra era)
forall a. Default a => a
def
PParams (ShelleyLedgerEra era)
-> (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> Either String (PParams (ShelleyLedgerEra era))
forall a b. a -> (a -> b) -> b
& [PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))]
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall (m :: * -> *) a. Monad m => [a -> m a] -> a -> m a
appFuns
[ \PParams (ShelleyLedgerEra era)
r -> do
coinsPerUtxoByte <-
Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "coinsPerUtxoByte" a) =>
LensLike' f s a
U5c.coinsPerUtxoByte LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid coinsPerUtxoByte"
compactCoinsPerUtxO <-
note "Could not convert coinsPerUtxoByte to compact form." $ L.toCompact (L.Coin coinsPerUtxoByte)
pure $ set L.ppCoinsPerUTxOByteL (L.CoinPerByte compactCoinsPerUtxO) r
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams (ShelleyLedgerEra era)) Word32
L.ppMaxTxSizeL ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word32
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word32 (Proto PParams) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word32) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxTxSize" a) =>
LensLike' f s a
U5c.maxTxSize LensLike' (Const Word32) (Proto PParams) Word64
-> ((Word32 -> Const Word32 Word32)
-> Word64 -> Const Word32 Word64)
-> Getting Word32 (Proto PParams) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, \PParams (ShelleyLedgerEra era)
r -> do
minFeeCoeff <-
Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeCoefficient" a) =>
LensLike' f s a
U5c.minFeeCoefficient LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid minFeeCoefficient"
minFeeCoeffCompact <-
note "Could not convert minFeeCoefficient to compact form." $ L.toCompact (L.Coin minFeeCoeff)
pure $ set L.ppTxFeePerByteL (L.CoinPerByte minFeeCoeffCompact) r
, \PParams (ShelleyLedgerEra era)
r -> do
minFeeConst <- Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeConstant" a) =>
LensLike' f s a
U5c.minFeeConstant LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid minFeeConstant"
pure $ set L.ppTxFeeFixedL (L.Coin minFeeConst) r
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word32
Lens' (PParams (ShelleyLedgerEra era)) Word32
L.ppMaxBBSizeL ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word32
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word32 (Proto PParams) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word32) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxBlockBodySize" a) =>
LensLike' f s a
U5c.maxBlockBodySize LensLike' (Const Word32) (Proto PParams) Word64
-> ((Word32 -> Const Word32 Word32)
-> Word64 -> Const Word32 Word64)
-> Getting Word32 (Proto PParams) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams (ShelleyLedgerEra era)) Word16
L.ppMaxBHSizeL ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word16
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word16 (Proto PParams) Word16 -> Word16
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word16) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxBlockHeaderSize" a) =>
LensLike' f s a
U5c.maxBlockHeaderSize LensLike' (Const Word16) (Proto PParams) Word64
-> ((Word16 -> Const Word16 Word16)
-> Word64 -> Const Word16 Word64)
-> Getting Word16 (Proto PParams) Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word16) -> SimpleGetter Word64 Word16
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, \PParams (ShelleyLedgerEra era)
r -> do
stakeKeyDeposit <-
Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "stakeKeyDeposit" a) =>
LensLike' f s a
U5c.stakeKeyDeposit LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid stakeKeyDeposit"
pure $ set L.ppKeyDepositL (L.Coin stakeKeyDeposit) r
, \PParams (ShelleyLedgerEra era)
r -> do
poolDeposit <- Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolDeposit" a) =>
LensLike' f s a
U5c.poolDeposit LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid poolDeposit"
pure $ set L.ppPoolDepositL (L.Coin poolDeposit) r
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) EpochInterval
Lens' (PParams (ShelleyLedgerEra era)) EpochInterval
L.ppEMaxL ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> EpochInterval
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams
-> Getting EpochInterval (Proto PParams) EpochInterval
-> EpochInterval
forall s a. s -> Getting a s a -> a
^. LensLike' (Const EpochInterval) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "poolRetirementEpochBound" a) =>
LensLike' f s a
U5c.poolRetirementEpochBound LensLike' (Const EpochInterval) (Proto PParams) Word64
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word64 -> Const EpochInterval Word64)
-> Getting EpochInterval (Proto PParams) EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Getting EpochInterval Word64 Word32
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word32 -> Const EpochInterval Word32)
-> (EpochInterval -> Const EpochInterval EpochInterval)
-> Word64
-> Const EpochInterval Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> EpochInterval) -> SimpleGetter Word32 EpochInterval
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> EpochInterval
L.EpochInterval)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) Word16
Lens' (PParams (ShelleyLedgerEra era)) Word16
L.ppNOptL ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word16
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word16 (Proto PParams) Word16 -> Word16
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word16) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "desiredNumberOfPools" a) =>
LensLike' f s a
U5c.desiredNumberOfPools LensLike' (Const Word16) (Proto PParams) Word64
-> ((Word16 -> Const Word16 Word16)
-> Word64 -> Const Word16 Word64)
-> Getting Word16 (Proto PParams) Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word16) -> SimpleGetter Word64 Word16
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, \PParams (ShelleyLedgerEra era)
r -> do
poolInfluence <-
Proto PParams
pp
Proto PParams
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
-> Maybe NonNegativeInterval
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolInfluence" a) =>
LensLike' f s a
U5c.poolInfluence
LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto RationalNumber)
-> ((Maybe NonNegativeInterval
-> Const (Maybe NonNegativeInterval) (Maybe NonNegativeInterval))
-> Proto RationalNumber
-> Const (Maybe NonNegativeInterval) (Proto RationalNumber))
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Maybe NonNegativeInterval)
-> SimpleGetter (Proto RationalNumber) (Maybe NonNegativeInterval)
forall s a. (s -> a) -> SimpleGetter s a
to (Ratio Integer -> Maybe NonNegativeInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe NonNegativeInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe NonNegativeInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational)
Maybe NonNegativeInterval
-> String -> Either String NonNegativeInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid poolInfluence"
pure $ set L.ppA0L poolInfluence r
, \PParams (ShelleyLedgerEra era)
r -> do
monetaryExpansion <-
Proto PParams
pp
Proto PParams
-> Getting
(Maybe UnitInterval) (Proto PParams) (Maybe UnitInterval)
-> Maybe UnitInterval
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const (Maybe UnitInterval)) (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "monetaryExpansion" a) =>
LensLike' f s a
U5c.monetaryExpansion
LensLike'
(Const (Maybe UnitInterval)) (Proto PParams) (Proto RationalNumber)
-> ((Maybe UnitInterval
-> Const (Maybe UnitInterval) (Maybe UnitInterval))
-> Proto RationalNumber
-> Const (Maybe UnitInterval) (Proto RationalNumber))
-> Getting
(Maybe UnitInterval) (Proto PParams) (Maybe UnitInterval)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Maybe UnitInterval)
-> SimpleGetter (Proto RationalNumber) (Maybe UnitInterval)
forall s a. (s -> a) -> SimpleGetter s a
to (Ratio Integer -> Maybe UnitInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe UnitInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe UnitInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational)
Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid monetaryExpansion"
pure $ set L.ppRhoL monetaryExpansion r
, \PParams (ShelleyLedgerEra era)
r -> do
treasuryExpansion <-
Proto PParams
pp
Proto PParams
-> Getting
(Maybe UnitInterval) (Proto PParams) (Maybe UnitInterval)
-> Maybe UnitInterval
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const (Maybe UnitInterval)) (Proto PParams) (Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "treasuryExpansion" a) =>
LensLike' f s a
U5c.treasuryExpansion
LensLike'
(Const (Maybe UnitInterval)) (Proto PParams) (Proto RationalNumber)
-> ((Maybe UnitInterval
-> Const (Maybe UnitInterval) (Maybe UnitInterval))
-> Proto RationalNumber
-> Const (Maybe UnitInterval) (Proto RationalNumber))
-> Getting
(Maybe UnitInterval) (Proto PParams) (Maybe UnitInterval)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Maybe UnitInterval)
-> SimpleGetter (Proto RationalNumber) (Maybe UnitInterval)
forall s a. (s -> a) -> SimpleGetter s a
to (Ratio Integer -> Maybe UnitInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe UnitInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe UnitInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational)
Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid treasuryExpansion"
pure $ set L.ppTauL treasuryExpansion r
, \PParams (ShelleyLedgerEra era)
r -> do
minPoolCost <- Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "minPoolCost" a) =>
LensLike' f s a
U5c.minPoolCost LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid minPoolCost"
pure $ set L.ppMinPoolCostL (L.Coin minPoolCost) r
, \PParams (ShelleyLedgerEra era)
r -> do
major <- Word64 -> Either String Version
forall (m :: * -> *). MonadFail m => Word64 -> m Version
L.mkVersion64 (Word64 -> Either String Version)
-> Word64 -> Either String Version
forall a b. (a -> b) -> a -> b
$ Proto PParams
pp Proto PParams -> Getting Word64 (Proto PParams) Word64 -> Word64
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word64) (Proto PParams) (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "protocolVersion" a) =>
LensLike' f s a
U5c.protocolVersion LensLike' (Const Word64) (Proto PParams) (Proto ProtocolVersion)
-> ((Word64 -> Const Word64 Word64)
-> Proto ProtocolVersion -> Const Word64 (Proto ProtocolVersion))
-> Getting Word64 (Proto PParams) Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' (Const Word64) (Proto ProtocolVersion) Word32
forall (f :: * -> *) s a.
(Functor f, HasField s "major" a) =>
LensLike' f s a
U5c.major LensLike' (Const Word64) (Proto ProtocolVersion) Word32
-> ((Word64 -> Const Word64 Word64)
-> Word32 -> Const Word64 Word32)
-> (Word64 -> Const Word64 Word64)
-> Proto ProtocolVersion
-> Const Word64 (Proto ProtocolVersion)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word64) -> SimpleGetter Word32 Word64
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral
pure $ set (L.ppProtocolVersionL . pvMajorL) major r
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((ProtVer -> Identity ProtVer)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. EraPParams era => Lens' (PParams era) ProtVer
Lens' (PParams (ShelleyLedgerEra era)) ProtVer
L.ppProtocolVersionL ((ProtVer -> Identity ProtVer)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> ((Natural -> Identity Natural) -> ProtVer -> Identity ProtVer)
-> (Natural -> Identity Natural)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Natural -> Identity Natural) -> ProtVer -> Identity ProtVer
Lens' ProtVer Natural
pvMinorL ((Natural -> Identity Natural)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Natural
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Natural (Proto PParams) Natural -> Natural
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Natural) (Proto PParams) (Proto ProtocolVersion)
forall (f :: * -> *) s a.
(Functor f, HasField s "protocolVersion" a) =>
LensLike' f s a
U5c.protocolVersion LensLike' (Const Natural) (Proto PParams) (Proto ProtocolVersion)
-> ((Natural -> Const Natural Natural)
-> Proto ProtocolVersion -> Const Natural (Proto ProtocolVersion))
-> Getting Natural (Proto PParams) Natural
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' (Const Natural) (Proto ProtocolVersion) Word32
forall (f :: * -> *) s a.
(Functor f, HasField s "minor" a) =>
LensLike' f s a
U5c.minor LensLike' (Const Natural) (Proto ProtocolVersion) Word32
-> ((Natural -> Const Natural Natural)
-> Word32 -> Const Natural Word32)
-> (Natural -> Const Natural Natural)
-> Proto ProtocolVersion
-> Const Natural (Proto ProtocolVersion)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Natural) -> SimpleGetter Word32 Natural
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Natural
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word32
Lens' (PParams (ShelleyLedgerEra era)) Word32
L.ppMaxValSizeL ((Word32 -> Identity Word32)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word32
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word32 (Proto PParams) Word32 -> Word32
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word32) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxValueSize" a) =>
LensLike' f s a
U5c.maxValueSize LensLike' (Const Word32) (Proto PParams) Word64
-> ((Word32 -> Const Word32 Word32)
-> Word64 -> Const Word32 Word64)
-> Getting Word32 (Proto PParams) Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (ShelleyLedgerEra era)) Word16
L.ppCollateralPercentageL ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word16
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word16 (Proto PParams) Word16 -> Word16
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word16) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "collateralPercentage" a) =>
LensLike' f s a
U5c.collateralPercentage LensLike' (Const Word16) (Proto PParams) Word64
-> ((Word16 -> Const Word16 Word16)
-> Word64 -> Const Word16 Word64)
-> Getting Word16 (Proto PParams) Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word16) -> SimpleGetter Word64 Word16
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (ShelleyLedgerEra era)) Word16
L.ppMaxCollateralInputsL ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word16
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word16 (Proto PParams) Word16 -> Word16
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word16) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "maxCollateralInputs" a) =>
LensLike' f s a
U5c.maxCollateralInputs LensLike' (Const Word16) (Proto PParams) Word64
-> ((Word16 -> Const Word16 Word16)
-> Word64 -> Const Word16 Word64)
-> Getting Word16 (Proto PParams) Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word16) -> SimpleGetter Word64 Word16
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, \PParams (ShelleyLedgerEra era)
r -> (CostModelApplyError -> String)
-> Either CostModelApplyError (PParams (ShelleyLedgerEra era))
-> Either String (PParams (ShelleyLedgerEra era))
forall a b c. (a -> b) -> Either a c -> Either b c
forall (p :: * -> * -> *) a b c.
Bifunctor p =>
(a -> b) -> p a c -> p b c
first CostModelApplyError -> String
forall a. Show a => a -> String
show (Either CostModelApplyError (PParams (ShelleyLedgerEra era))
-> Either String (PParams (ShelleyLedgerEra era)))
-> Either CostModelApplyError (PParams (ShelleyLedgerEra era))
-> Either String (PParams (ShelleyLedgerEra era))
forall a b. (a -> b) -> a -> b
$ do
cm1 <- Language -> [Int64] -> Either CostModelApplyError CostModel
L.mkCostModel Language
L.PlutusV1 ([Int64] -> Either CostModelApplyError CostModel)
-> [Int64] -> Either CostModelApplyError CostModel
forall a b. (a -> b) -> a -> b
$ Proto PParams
pp Proto PParams -> Getting [Int64] (Proto PParams) [Int64] -> [Int64]
forall s a. s -> Getting a s a -> a
^. LensLike' (Const [Int64]) (Proto PParams) (Proto CostModels)
forall (f :: * -> *) s a.
(Functor f, HasField s "costModels" a) =>
LensLike' f s a
U5c.costModels LensLike' (Const [Int64]) (Proto PParams) (Proto CostModels)
-> (([Int64] -> Const [Int64] [Int64])
-> Proto CostModels -> Const [Int64] (Proto CostModels))
-> Getting [Int64] (Proto PParams) [Int64]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike' (Const [Int64]) (Proto CostModels) (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "plutusV1" a) =>
LensLike' f s a
U5c.plutusV1 LensLike' (Const [Int64]) (Proto CostModels) (Proto CostModel)
-> (([Int64] -> Const [Int64] [Int64])
-> Proto CostModel -> Const [Int64] (Proto CostModel))
-> ([Int64] -> Const [Int64] [Int64])
-> Proto CostModels
-> Const [Int64] (Proto CostModels)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Int64] -> Const [Int64] [Int64])
-> Proto CostModel -> Const [Int64] (Proto CostModel)
forall (f :: * -> *) s a.
(Functor f, HasField s "values" a) =>
LensLike' f s a
U5c.values
cm2 <- L.mkCostModel L.PlutusV2 $ pp ^. U5c.costModels . U5c.plutusV2 . U5c.values
cm3 <- L.mkCostModel L.PlutusV3 $ pp ^. U5c.costModels . U5c.plutusV3 . U5c.values
cm4 <- L.mkCostModel L.PlutusV4 $ pp ^. U5c.costModels . U5c.plutusV4 . U5c.values
let nonEmptyCostModels =
[(Language, CostModel)] -> Map Language CostModel
[Item (Map Language CostModel)] -> Map Language CostModel
forall l. IsList l => [Item l] -> l
fromList ([(Language, CostModel)] -> Map Language CostModel)
-> ((CostModel -> Maybe (Language, CostModel))
-> [(Language, CostModel)])
-> (CostModel -> Maybe (Language, CostModel))
-> Map Language CostModel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((CostModel -> Maybe (Language, CostModel))
-> [CostModel] -> [(Language, CostModel)])
-> [CostModel]
-> (CostModel -> Maybe (Language, CostModel))
-> [(Language, CostModel)]
forall a b c. (a -> b -> c) -> b -> a -> c
flip (CostModel -> Maybe (Language, CostModel))
-> [CostModel] -> [(Language, CostModel)]
forall a b. (a -> Maybe b) -> [a] -> [b]
mapMaybe [Item [CostModel]
CostModel
cm1, Item [CostModel]
CostModel
cm2, Item [CostModel]
CostModel
cm3, Item [CostModel]
CostModel
cm4] ((CostModel -> Maybe (Language, CostModel))
-> Map Language CostModel)
-> (CostModel -> Maybe (Language, CostModel))
-> Map Language CostModel
forall a b. (a -> b) -> a -> b
$ \CostModel
cm ->
if Bool -> Bool
not ([Int64] -> Bool
forall a. [a] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null ([Int64] -> Bool) -> [Int64] -> Bool
forall a b. (a -> b) -> a -> b
$ CostModel -> [Int64]
L.getCostModelParams CostModel
cm)
then (Language, CostModel) -> Maybe (Language, CostModel)
forall a. a -> Maybe a
Just (CostModel -> Language
L.getCostModelLanguage CostModel
cm, CostModel
cm)
else Maybe (Language, CostModel)
forall a. Maybe a
Nothing
pure $
r & L.ppCostModelsL .~ L.mkCostModels nonEmptyCostModels
, \PParams (ShelleyLedgerEra era)
r -> do
steps <-
Proto PParams
pp
Proto PParams
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
-> Maybe NonNegativeInterval
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto ExPrices)
forall (f :: * -> *) s a.
(Functor f, HasField s "prices" a) =>
LensLike' f s a
U5c.prices
LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto ExPrices)
-> ((Maybe NonNegativeInterval
-> Const (Maybe NonNegativeInterval) (Maybe NonNegativeInterval))
-> Proto ExPrices
-> Const (Maybe NonNegativeInterval) (Proto ExPrices))
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LensLike'
(Const (Maybe NonNegativeInterval))
(Proto ExPrices)
(Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "steps" a) =>
LensLike' f s a
U5c.steps
LensLike'
(Const (Maybe NonNegativeInterval))
(Proto ExPrices)
(Proto RationalNumber)
-> ((Maybe NonNegativeInterval
-> Const (Maybe NonNegativeInterval) (Maybe NonNegativeInterval))
-> Proto RationalNumber
-> Const (Maybe NonNegativeInterval) (Proto RationalNumber))
-> (Maybe NonNegativeInterval
-> Const (Maybe NonNegativeInterval) (Maybe NonNegativeInterval))
-> Proto ExPrices
-> Const (Maybe NonNegativeInterval) (Proto ExPrices)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Maybe NonNegativeInterval)
-> SimpleGetter (Proto RationalNumber) (Maybe NonNegativeInterval)
forall s a. (s -> a) -> SimpleGetter s a
to (Ratio Integer -> Maybe NonNegativeInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe NonNegativeInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe NonNegativeInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational)
Maybe NonNegativeInterval
-> String -> Either String NonNegativeInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid prices.steps"
mem <-
pp
^. U5c.prices
. U5c.memory
. to (L.boundRational <=< utxoRpcRationalNumberToRational)
?! "Invalid prices.mem"
pure $
r
& L.ppPricesL . prStepsL .~ steps
& L.ppPricesL . prMemL .~ mem
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((ExUnits -> Identity ExUnits)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) ExUnits
Lens' (PParams (ShelleyLedgerEra era)) ExUnits
L.ppMaxTxExUnitsL ((ExUnits -> Identity ExUnits)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> ExUnits
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting ExUnits (Proto PParams) ExUnits -> ExUnits
forall s a. s -> Getting a s a -> a
^. LensLike' (Const ExUnits) (Proto PParams) (Proto ExUnits)
forall (f :: * -> *) s a.
(Functor f, HasField s "maxExecutionUnitsPerTransaction" a) =>
LensLike' f s a
U5c.maxExecutionUnitsPerTransaction LensLike' (Const ExUnits) (Proto PParams) (Proto ExUnits)
-> ((ExUnits -> Const ExUnits ExUnits)
-> Proto ExUnits -> Const ExUnits (Proto ExUnits))
-> Getting ExUnits (Proto PParams) ExUnits
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto ExUnits -> ExUnits) -> SimpleGetter (Proto ExUnits) ExUnits
forall s a. (s -> a) -> SimpleGetter s a
to Proto ExUnits -> ExUnits
forall t s. Inject t s => t -> s
inject)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((ExUnits -> Identity ExUnits)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. AlonzoEraPParams era => Lens' (PParams era) ExUnits
Lens' (PParams (ShelleyLedgerEra era)) ExUnits
L.ppMaxBlockExUnitsL ((ExUnits -> Identity ExUnits)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> ExUnits
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting ExUnits (Proto PParams) ExUnits -> ExUnits
forall s a. s -> Getting a s a -> a
^. LensLike' (Const ExUnits) (Proto PParams) (Proto ExUnits)
forall (f :: * -> *) s a.
(Functor f, HasField s "maxExecutionUnitsPerBlock" a) =>
LensLike' f s a
U5c.maxExecutionUnitsPerBlock LensLike' (Const ExUnits) (Proto PParams) (Proto ExUnits)
-> ((ExUnits -> Const ExUnits ExUnits)
-> Proto ExUnits -> Const ExUnits (Proto ExUnits))
-> Getting ExUnits (Proto PParams) ExUnits
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto ExUnits -> ExUnits) -> SimpleGetter (Proto ExUnits) ExUnits
forall s a. (s -> a) -> SimpleGetter s a
to Proto ExUnits -> ExUnits
forall t s. Inject t s => t -> s
inject)
, \PParams (ShelleyLedgerEra era)
r -> do
minFeeScriptRefCostPerByte <-
Proto PParams
pp
Proto PParams
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
-> Maybe NonNegativeInterval
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto RationalNumber)
forall (f :: * -> *) s a.
(Functor f, HasField s "minFeeScriptRefCostPerByte" a) =>
LensLike' f s a
U5c.minFeeScriptRefCostPerByte
LensLike'
(Const (Maybe NonNegativeInterval))
(Proto PParams)
(Proto RationalNumber)
-> ((Maybe NonNegativeInterval
-> Const (Maybe NonNegativeInterval) (Maybe NonNegativeInterval))
-> Proto RationalNumber
-> Const (Maybe NonNegativeInterval) (Proto RationalNumber))
-> Getting
(Maybe NonNegativeInterval)
(Proto PParams)
(Maybe NonNegativeInterval)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto RationalNumber -> Maybe NonNegativeInterval)
-> SimpleGetter (Proto RationalNumber) (Maybe NonNegativeInterval)
forall s a. (s -> a) -> SimpleGetter s a
to (Ratio Integer -> Maybe NonNegativeInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe NonNegativeInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe NonNegativeInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational)
Maybe NonNegativeInterval
-> String -> Either String NonNegativeInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid minFeeScriptRefCostPerByte"
pure $ set L.ppMinFeeRefScriptCostPerByteL minFeeScriptRefCostPerByte r
, \PParams (ShelleyLedgerEra era)
r -> do
let thresholds :: [Proto RationalNumber]
thresholds = Proto PParams
pp Proto PParams
-> Getting
[Proto RationalNumber] (Proto PParams) [Proto RationalNumber]
-> [Proto RationalNumber]
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const [Proto RationalNumber])
(Proto PParams)
(Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "poolVotingThresholds" a) =>
LensLike' f s a
U5c.poolVotingThresholds LensLike'
(Const [Proto RationalNumber])
(Proto PParams)
(Proto VotingThresholds)
-> (([Proto RationalNumber]
-> Const [Proto RationalNumber] [Proto RationalNumber])
-> Proto VotingThresholds
-> Const [Proto RationalNumber] (Proto VotingThresholds))
-> Getting
[Proto RationalNumber] (Proto PParams) [Proto RationalNumber]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Proto RationalNumber]
-> Const [Proto RationalNumber] [Proto RationalNumber])
-> Proto VotingThresholds
-> Const [Proto RationalNumber] (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "thresholds" a) =>
LensLike' f s a
U5c.thresholds
Bool -> Either String () -> Either String ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when ([Proto RationalNumber] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Proto RationalNumber]
thresholds Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
5) (Either String () -> Either String ())
-> Either String () -> Either String ()
forall a b. (a -> b) -> a -> b
$
String -> Either String ()
forall a. String -> Either String a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (String -> Either String ()) -> String -> Either String ()
forall a b. (a -> b) -> a -> b
$
String
"Invalid number of thresholds: " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> Int -> String
forall a. Show a => a -> String
show ([Proto RationalNumber] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Proto RationalNumber]
thresholds)
[ motionNoConfidence
, committeeNormal
, committeeNoConfidence
, hardForkInitiation
, ppSecurityGroup
] <-
((Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)
-> Either String UnitInterval)
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
-> Either String [UnitInterval]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (((Maybe UnitInterval -> Either String UnitInterval)
-> Maybe UnitInterval -> Either String UnitInterval)
-> (Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)
-> Either String UnitInterval
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (Maybe UnitInterval -> Either String UnitInterval)
-> Maybe UnitInterval -> Either String UnitInterval
forall a b. (a -> b) -> a -> b
($))
([(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
-> Either String [UnitInterval])
-> ([Maybe UnitInterval]
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)])
-> [Maybe UnitInterval]
-> Either String [UnitInterval]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Maybe UnitInterval -> Either String UnitInterval]
-> [Maybe UnitInterval]
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
forall a b. [a] -> [b] -> [(a, b)]
zip
[ (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in poolVotingThresholds: motionNoConfidence")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in poolVotingThresholds: committeeNormal")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in poolVotingThresholds: committeeNoConfidence")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in poolVotingThresholds: hardForkInitiation")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in poolVotingThresholds: ppSecurityGroup")
]
([Maybe UnitInterval] -> Either String [UnitInterval])
-> [Maybe UnitInterval] -> Either String [UnitInterval]
forall a b. (a -> b) -> a -> b
$ (Proto RationalNumber -> Maybe UnitInterval)
-> [Proto RationalNumber] -> [Maybe UnitInterval]
forall a b. (a -> b) -> [a] -> [b]
map (Ratio Integer -> Maybe UnitInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe UnitInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe UnitInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational) [Proto RationalNumber]
thresholds
pure $
r
& L.ppPoolVotingThresholdsL . L.pvtMotionNoConfidenceL .~ motionNoConfidence
& L.ppPoolVotingThresholdsL . L.pvtCommitteeNormalL .~ committeeNormal
& L.ppPoolVotingThresholdsL . L.pvtCommitteeNoConfidenceL .~ committeeNoConfidence
& L.ppPoolVotingThresholdsL . L.pvtHardForkInitiationL .~ hardForkInitiation
& L.ppPoolVotingThresholdsL . L.pvtPPSecurityGroupL .~ ppSecurityGroup
, \PParams (ShelleyLedgerEra era)
r -> do
let thresholds :: [Proto RationalNumber]
thresholds = Proto PParams
pp Proto PParams
-> Getting
[Proto RationalNumber] (Proto PParams) [Proto RationalNumber]
-> [Proto RationalNumber]
forall s a. s -> Getting a s a -> a
^. LensLike'
(Const [Proto RationalNumber])
(Proto PParams)
(Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "drepVotingThresholds" a) =>
LensLike' f s a
U5c.drepVotingThresholds LensLike'
(Const [Proto RationalNumber])
(Proto PParams)
(Proto VotingThresholds)
-> (([Proto RationalNumber]
-> Const [Proto RationalNumber] [Proto RationalNumber])
-> Proto VotingThresholds
-> Const [Proto RationalNumber] (Proto VotingThresholds))
-> Getting
[Proto RationalNumber] (Proto PParams) [Proto RationalNumber]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([Proto RationalNumber]
-> Const [Proto RationalNumber] [Proto RationalNumber])
-> Proto VotingThresholds
-> Const [Proto RationalNumber] (Proto VotingThresholds)
forall (f :: * -> *) s a.
(Functor f, HasField s "thresholds" a) =>
LensLike' f s a
U5c.thresholds
Bool -> Either String () -> Either String ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when ([Proto RationalNumber] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Proto RationalNumber]
thresholds Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= Int
10) (Either String () -> Either String ())
-> Either String () -> Either String ()
forall a b. (a -> b) -> a -> b
$
String -> Either String ()
forall a. String -> Either String a
forall e (m :: * -> *) a. MonadError e m => e -> m a
throwError (String -> Either String ()) -> String -> Either String ()
forall a b. (a -> b) -> a -> b
$
String
"Invalid number of thresholds: " String -> String -> String
forall a. Semigroup a => a -> a -> a
<> Int -> String
forall a. Show a => a -> String
show ([Proto RationalNumber] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [Proto RationalNumber]
thresholds)
[ motionNoConfidence
, committeeNormal
, committeeNoConfidence
, updateToConstitution
, hardforkInitiation
, ppNetworkGroup
, ppEconomicGroup
, ppTechnicalGroup
, ppGovGroup
, treasuryWithdrawal
] <-
((Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)
-> Either String UnitInterval)
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
-> Either String [UnitInterval]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> [a] -> f [b]
traverse (((Maybe UnitInterval -> Either String UnitInterval)
-> Maybe UnitInterval -> Either String UnitInterval)
-> (Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)
-> Either String UnitInterval
forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry (Maybe UnitInterval -> Either String UnitInterval)
-> Maybe UnitInterval -> Either String UnitInterval
forall a b. (a -> b) -> a -> b
($))
([(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
-> Either String [UnitInterval])
-> ([Maybe UnitInterval]
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)])
-> [Maybe UnitInterval]
-> Either String [UnitInterval]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Maybe UnitInterval -> Either String UnitInterval]
-> [Maybe UnitInterval]
-> [(Maybe UnitInterval -> Either String UnitInterval,
Maybe UnitInterval)]
forall a b. [a] -> [b] -> [(a, b)]
zip
[ (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: motionNoConfidence")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: committeeNormal")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: committeeNoConfidence")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: updateToConstitution")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: hardforkInitiation")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: ppNetworkGroup")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: ppEconomicGroup")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: ppTechnicalGroup")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: ppGovGroup")
, (Maybe UnitInterval -> String -> Either String UnitInterval
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid value in drepVotingThresholds: treasuryWithdrawal")
]
([Maybe UnitInterval] -> Either String [UnitInterval])
-> [Maybe UnitInterval] -> Either String [UnitInterval]
forall a b. (a -> b) -> a -> b
$ (Proto RationalNumber -> Maybe UnitInterval)
-> [Proto RationalNumber] -> [Maybe UnitInterval]
forall a b. (a -> b) -> [a] -> [b]
map (Ratio Integer -> Maybe UnitInterval
forall r. BoundedRational r => Ratio Integer -> Maybe r
L.boundRational (Ratio Integer -> Maybe UnitInterval)
-> (Proto RationalNumber -> Maybe (Ratio Integer))
-> Proto RationalNumber
-> Maybe UnitInterval
forall (m :: * -> *) b c a.
Monad m =>
(b -> m c) -> (a -> m b) -> a -> m c
<=< Proto RationalNumber -> Maybe (Ratio Integer)
utxoRpcRationalNumberToRational) [Proto RationalNumber]
thresholds
pure $
r
& L.ppDRepVotingThresholdsL . L.dvtMotionNoConfidenceL .~ motionNoConfidence
& L.ppDRepVotingThresholdsL . L.dvtCommitteeNormalL .~ committeeNormal
& L.ppDRepVotingThresholdsL . L.dvtCommitteeNoConfidenceL .~ committeeNoConfidence
& L.ppDRepVotingThresholdsL . L.dvtUpdateToConstitutionL .~ updateToConstitution
& L.ppDRepVotingThresholdsL . L.dvtHardForkInitiationL .~ hardforkInitiation
& L.ppDRepVotingThresholdsL . L.dvtPPNetworkGroupL .~ ppNetworkGroup
& L.ppDRepVotingThresholdsL . L.dvtPPEconomicGroupL .~ ppEconomicGroup
& L.ppDRepVotingThresholdsL . L.dvtPPTechnicalGroupL .~ ppTechnicalGroup
& L.ppDRepVotingThresholdsL . L.dvtPPGovGroupL .~ ppGovGroup
& L.ppDRepVotingThresholdsL . L.dvtTreasuryWithdrawalL .~ treasuryWithdrawal
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era. ConwayEraPParams era => Lens' (PParams era) Word16
Lens' (PParams (ShelleyLedgerEra era)) Word16
L.ppCommitteeMinSizeL ((Word16 -> Identity Word16)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> Word16
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams -> Getting Word16 (Proto PParams) Word16 -> Word16
forall s a. s -> Getting a s a -> a
^. LensLike' (Const Word16) (Proto PParams) Word32
forall (f :: * -> *) s a.
(Functor f, HasField s "minCommitteeSize" a) =>
LensLike' f s a
U5c.minCommitteeSize LensLike' (Const Word16) (Proto PParams) Word32
-> ((Word16 -> Const Word16 Word16)
-> Word32 -> Const Word16 Word32)
-> Getting Word16 (Proto PParams) Word16
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> Word16) -> SimpleGetter Word32 Word16
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> Word16
forall a b. (Integral a, Num b) => a -> b
fromIntegral)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (ShelleyLedgerEra era)) EpochInterval
L.ppCommitteeMaxTermLengthL ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> EpochInterval
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams
-> Getting EpochInterval (Proto PParams) EpochInterval
-> EpochInterval
forall s a. s -> Getting a s a -> a
^. LensLike' (Const EpochInterval) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "committeeTermLimit" a) =>
LensLike' f s a
U5c.committeeTermLimit LensLike' (Const EpochInterval) (Proto PParams) Word64
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word64 -> Const EpochInterval Word64)
-> Getting EpochInterval (Proto PParams) EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Getting EpochInterval Word64 Word32
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word32 -> Const EpochInterval Word32)
-> (EpochInterval -> Const EpochInterval EpochInterval)
-> Word64
-> Const EpochInterval Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> EpochInterval) -> SimpleGetter Word32 EpochInterval
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> EpochInterval
L.EpochInterval)
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure
(PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ( (EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (ShelleyLedgerEra era)) EpochInterval
L.ppGovActionLifetimeL
((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> EpochInterval
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams
-> Getting EpochInterval (Proto PParams) EpochInterval
-> EpochInterval
forall s a. s -> Getting a s a -> a
^. LensLike' (Const EpochInterval) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "governanceActionValidityPeriod" a) =>
LensLike' f s a
U5c.governanceActionValidityPeriod LensLike' (Const EpochInterval) (Proto PParams) Word64
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word64 -> Const EpochInterval Word64)
-> Getting EpochInterval (Proto PParams) EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Getting EpochInterval Word64 Word32
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word32 -> Const EpochInterval Word32)
-> (EpochInterval -> Const EpochInterval EpochInterval)
-> Word64
-> Const EpochInterval Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> EpochInterval) -> SimpleGetter Word32 EpochInterval
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> EpochInterval
L.EpochInterval
)
, \PParams (ShelleyLedgerEra era)
r -> do
govActionDeposit <-
Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "governanceActionDeposit" a) =>
LensLike' f s a
U5c.governanceActionDeposit LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid governanceActionDeposit"
pure $ set L.ppGovActionDepositL (L.Coin govActionDeposit) r
, \PParams (ShelleyLedgerEra era)
r -> do
drepDeposit <- Proto PParams
pp Proto PParams
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
-> Maybe Integer
forall s a. s -> Getting a s a -> a
^. LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
forall (f :: * -> *) s a.
(Functor f, HasField s "drepDeposit" a) =>
LensLike' f s a
U5c.drepDeposit LensLike' (Const (Maybe Integer)) (Proto PParams) (Proto BigInt)
-> ((Maybe Integer -> Const (Maybe Integer) (Maybe Integer))
-> Proto BigInt -> Const (Maybe Integer) (Proto BigInt))
-> Getting (Maybe Integer) (Proto PParams) (Maybe Integer)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Proto BigInt -> Maybe Integer)
-> SimpleGetter (Proto BigInt) (Maybe Integer)
forall s a. (s -> a) -> SimpleGetter s a
to Proto BigInt -> Maybe Integer
forall (m :: * -> *).
(HasCallStack, MonadThrow m) =>
Proto BigInt -> m Integer
utxoRpcBigIntToInteger Maybe Integer -> String -> Either String Integer
forall e (m :: * -> *) a. MonadError e m => Maybe a -> e -> m a
?! String
"Invalid drepDeposit"
pure $ set L.ppDRepDepositL (L.Coin drepDeposit) r
, PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall a. a -> Either String a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era)))
-> (PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era))
-> PParams (ShelleyLedgerEra era)
-> Either String (PParams (ShelleyLedgerEra era))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era))
forall era.
ConwayEraPParams era =>
Lens' (PParams era) EpochInterval
Lens' (PParams (ShelleyLedgerEra era)) EpochInterval
L.ppDRepActivityL ((EpochInterval -> Identity EpochInterval)
-> PParams (ShelleyLedgerEra era)
-> Identity (PParams (ShelleyLedgerEra era)))
-> EpochInterval
-> PParams (ShelleyLedgerEra era)
-> PParams (ShelleyLedgerEra era)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Proto PParams
pp Proto PParams
-> Getting EpochInterval (Proto PParams) EpochInterval
-> EpochInterval
forall s a. s -> Getting a s a -> a
^. LensLike' (Const EpochInterval) (Proto PParams) Word64
forall (f :: * -> *) s a.
(Functor f, HasField s "drepInactivityPeriod" a) =>
LensLike' f s a
U5c.drepInactivityPeriod LensLike' (Const EpochInterval) (Proto PParams) Word64
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word64 -> Const EpochInterval Word64)
-> Getting EpochInterval (Proto PParams) EpochInterval
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word64 -> Word32) -> SimpleGetter Word64 Word32
forall s a. (s -> a) -> SimpleGetter s a
to Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral Getting EpochInterval Word64 Word32
-> ((EpochInterval -> Const EpochInterval EpochInterval)
-> Word32 -> Const EpochInterval Word32)
-> (EpochInterval -> Const EpochInterval EpochInterval)
-> Word64
-> Const EpochInterval Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Word32 -> EpochInterval) -> SimpleGetter Word32 EpochInterval
forall s a. (s -> a) -> SimpleGetter s a
to Word32 -> EpochInterval
L.EpochInterval)
]
where
appFuns :: Monad m => [a -> m a] -> a -> m a
appFuns :: forall (m :: * -> *) a. Monad m => [a -> m a] -> a -> m a
appFuns [a -> m a]
fs a
a0 = ((a -> m a) -> m a -> m a) -> m a -> [a -> m a] -> m a
forall a b. (a -> b -> b) -> b -> [a] -> b
forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (a -> m a) -> m a -> m a
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
(=<<) (a -> m a
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure a
a0) [a -> m a]
fs
pvMajorL :: Lens' L.ProtVer L.Version
pvMajorL :: Lens' ProtVer Version
pvMajorL = (ProtVer -> Version)
-> (ProtVer -> Version -> ProtVer) -> Lens' ProtVer Version
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens ProtVer -> Version
L.pvMajor ((ProtVer -> Version -> ProtVer) -> Lens' ProtVer Version)
-> (ProtVer -> Version -> ProtVer) -> Lens' ProtVer Version
forall a b. (a -> b) -> a -> b
$ \ProtVer
p Version
v -> ProtVer
p{L.pvMajor = v}
pvMinorL :: Lens' L.ProtVer Natural
pvMinorL :: Lens' ProtVer Natural
pvMinorL = (ProtVer -> Natural)
-> (ProtVer -> Natural -> ProtVer) -> Lens' ProtVer Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens ProtVer -> Natural
L.pvMinor ((ProtVer -> Natural -> ProtVer) -> Lens' ProtVer Natural)
-> (ProtVer -> Natural -> ProtVer) -> Lens' ProtVer Natural
forall a b. (a -> b) -> a -> b
$ \ProtVer
p Natural
v -> ProtVer
p{L.pvMinor = v}
prStepsL :: Lens' L.Prices L.NonNegativeInterval
prStepsL :: Lens' Prices NonNegativeInterval
prStepsL = (Prices -> NonNegativeInterval)
-> (Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens Prices -> NonNegativeInterval
L.prSteps ((Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval)
-> (Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval
forall a b. (a -> b) -> a -> b
$ \Prices
p NonNegativeInterval
v -> Prices
p{L.prSteps = v}
prMemL :: Lens' L.Prices L.NonNegativeInterval
prMemL :: Lens' Prices NonNegativeInterval
prMemL = (Prices -> NonNegativeInterval)
-> (Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
lens Prices -> NonNegativeInterval
L.prMem ((Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval)
-> (Prices -> NonNegativeInterval -> Prices)
-> Lens' Prices NonNegativeInterval
forall a b. (a -> b) -> a -> b
$ \Prices
p NonNegativeInterval
v -> Prices
p{L.prMem = v}