Skip to content

Commit f9f17a3

Browse files
committed
5191 Rename PoolParams
Rename PoolParams to StatekPoolParams, to avoid confusion with protocol parameters
1 parent 640fb66 commit f9f17a3

File tree

92 files changed

+484
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+484
-484
lines changed

docs/reward-calculation/HowRewardCalculationWorks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This is a Haskell Datatype (Map (Credential 'Staking) (KeyHash StakePool)), whi
3838
Only registered credentials will receive rewards.
3939

4040
3. Information about which pool operators are currently registered to operate pools, and the parameters under which the pools operate.
41-
This is a Haskell Datatype (Map (KeyHash StakePool) PoolParams), which we will call the `poolParamsMap` . Rewards for UTxO entries delegated
41+
This is a Haskell Datatype (Map (KeyHash StakePool) StakePoolParams), which we will call the `poolParamsMap` . Rewards for UTxO entries delegated
4242
to non registered Pools are distributed to either the Treasury or the Reserves.
4343

4444
4. Information about which pools are currently scheduled to retire, and when.
@@ -193,7 +193,7 @@ The actual values are stored in internal maps found in the type family `CertStat
193193
194194
Map (Credential 'Staking) (StrictMaybe (KeyHash 'StakePool)) -- The User registration map
195195
Map (Credential 'Staking) Coin -- The User Rewards map
196-
Map (KeyHash 'StakePool) PoolParams -- The StakePool registration map
196+
Map (KeyHash 'StakePool) StakePoolParams -- The StakePool registration map
197197
```
198198

199199
A `Reward` contains information about a computed reward, that has yet to be applied to the internal Rewards map.

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Plutus/TxInfo.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import Cardano.Ledger.Plutus.Language (
7575
SLanguage (..),
7676
)
7777
import Cardano.Ledger.Plutus.TxInfo
78-
import Cardano.Ledger.PoolParams (PoolParams (..))
78+
import Cardano.Ledger.PoolParams (StakePoolParams (..))
7979
import Cardano.Ledger.Rules.ValidationMode (Inject (..))
8080
import Cardano.Ledger.State (UTxO (..))
8181
import Cardano.Ledger.TxIn (TxIn (..), txInToText)
@@ -349,7 +349,7 @@ transTxCertCommon = \case
349349
Just $ PV1.DCertDelegDeRegKey (PV1.StakingHash (transCred stakeCred))
350350
DelegStakeTxCert stakeCred keyHash ->
351351
Just $ PV1.DCertDelegDelegate (PV1.StakingHash (transCred stakeCred)) (transKeyHash keyHash)
352-
RegPoolTxCert (PoolParams {ppId, ppVrf}) ->
352+
RegPoolTxCert (StakePoolParams {ppId, ppVrf}) ->
353353
Just $
354354
PV1.DCertPoolRegister
355355
(transKeyHash ppId)

eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxowSpec/Invalid.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Cardano.Ledger.Plutus (
3131
hashPlutusScript,
3232
withSLanguage,
3333
)
34-
import Cardano.Ledger.Shelley.LedgerState (epochStatePoolParamsL, nesEsL)
34+
import Cardano.Ledger.Shelley.LedgerState (epochStateStakePoolParamsL, nesEsL)
3535
import Cardano.Ledger.Shelley.Rules (ShelleyUtxowPredFailure (..))
3636
import qualified Data.Map.Strict as Map
3737
import Data.Maybe (isJust)
@@ -159,7 +159,7 @@ spec = describe "Invalid transactions" $ do
159159
it "No ExtraRedeemers on same script certificates" $ do
160160
Positive n <- arbitrary
161161
replicateM_ n $ freshKeyHash >>= registerPool
162-
pools <- getsNES $ nesEsL . epochStatePoolParamsL
162+
pools <- getsNES $ nesEsL . epochStateStakePoolParamsL
163163
poolId <- elements $ Map.keys pools
164164
let scriptHash = alwaysSucceedsNoDatumHash
165165
cred = ScriptHashObj scriptHash
@@ -256,7 +256,7 @@ spec = describe "Invalid transactions" $ do
256256
let scriptHash = alwaysSucceedsWithDatumHash
257257
Positive n <- arbitrary
258258
replicateM_ n $ freshKeyHash >>= registerPool
259-
pools <- getsNES $ nesEsL . epochStatePoolParamsL
259+
pools <- getsNES $ nesEsL . epochStateStakePoolParamsL
260260
poolId <- elements $ Map.keys pools
261261
let cred = ScriptHashObj scriptHash
262262
certs =

eras/conway/impl/src/Cardano/Ledger/Conway/Governance.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ import Cardano.Ledger.Conway.Governance.Proposals
215215
import Cardano.Ledger.Conway.State
216216
import Cardano.Ledger.Core
217217
import Cardano.Ledger.Credential (Credential)
218-
import Cardano.Ledger.PoolParams (PoolParams (ppRewardAccount))
218+
import Cardano.Ledger.PoolParams (StakePoolParams (ppRewardAccount))
219219
import Cardano.Ledger.Shelley.LedgerState (
220220
EpochState (..),
221221
NewEpochState (..),
222222
epochStateGovStateL,
223-
epochStatePoolParamsL,
223+
epochStateStakePoolParamsL,
224224
esLStateL,
225225
lsCertState,
226226
lsUTxOState,
@@ -513,7 +513,7 @@ setFreshDRepPulsingState epochNo stakePoolDistr epochState = do
513513
, dpProposals = proposalsActions props
514514
, dpProposalDeposits = proposalsDeposits props
515515
, dpGlobals = globals
516-
, dpPoolParams = epochState ^. epochStatePoolParamsL
516+
, dpStakePoolParams = epochState ^. epochStateStakePoolParamsL
517517
}
518518
)
519519
pure $ epochState & epochStateGovStateL .~ govState'
@@ -561,7 +561,7 @@ defaultStakePoolVote ::
561561
-- | Specify the key hash of the pool whose default vote should be returned.
562562
KeyHash 'StakePool ->
563563
-- | Registered Stake Pools
564-
Map (KeyHash 'StakePool) PoolParams ->
564+
Map (KeyHash 'StakePool) StakePoolParams ->
565565
-- | Delegations of staking credneitals to a DRep
566566
Accounts era ->
567567
DefaultVote

eras/conway/impl/src/Cardano/Ledger/Conway/Governance/DRepPulser.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ import Cardano.Ledger.Conway.Governance.Procedures (GovActionState)
7171
import Cardano.Ledger.Conway.State hiding (balance)
7272
import Cardano.Ledger.Core
7373
import Cardano.Ledger.Credential (Credential (..))
74-
import Cardano.Ledger.PoolParams (PoolParams)
74+
import Cardano.Ledger.PoolParams (StakePoolParams)
7575
import Control.DeepSeq (NFData (..), deepseq)
7676
import Control.Monad.Trans.Reader (Reader, runReader)
7777
import Control.State.Transition.Extended
@@ -283,7 +283,7 @@ data DRepPulser era (m :: Type -> Type) ans where
283283
, dpProposalDeposits :: !(Map (Credential 'Staking) (CompactForm Coin))
284284
-- ^ Snapshot of the proposal-deposits per reward-account-staking-credential
285285
, dpGlobals :: !Globals
286-
, dpPoolParams :: !(Map (KeyHash 'StakePool) PoolParams)
286+
, dpStakePoolParams :: !(Map (KeyHash 'StakePool) StakePoolParams)
287287
-- ^ Snapshot of the parameters of stake pools -
288288
-- this is needed to get the reward account for SPO vote calculation
289289
} ->
@@ -339,7 +339,7 @@ instance
339339
, noThunks ctxt (dpProposals drp)
340340
, noThunks ctxt (dpProposalDeposits drp)
341341
, noThunks ctxt (dpGlobals drp)
342-
, noThunks ctxt (dpPoolParams drp)
342+
, noThunks ctxt (dpStakePoolParams drp)
343343
]
344344

345345
instance
@@ -411,7 +411,7 @@ finishDRepPulser (DRPulsing (DRepPulser {..})) =
411411
, reCurrentEpoch = dpCurrentEpoch
412412
, reCommitteeState = dpCommitteeState
413413
, reAccounts = dpAccounts
414-
, rePoolParams = dpPoolParams
414+
, reStakePoolParams = dpStakePoolParams
415415
}
416416
!ratifySig = RatifySignal dpProposals
417417
!ratifyState =

eras/conway/impl/src/Cardano/Ledger/Conway/Governance/Internal.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ import Cardano.Ledger.Conway.PParams (
110110
import Cardano.Ledger.Conway.State
111111
import Cardano.Ledger.Core
112112
import Cardano.Ledger.Credential (Credential (..))
113-
import Cardano.Ledger.PoolParams (PoolParams)
113+
import Cardano.Ledger.PoolParams (StakePoolParams)
114114
import Cardano.Ledger.Shelley.LedgerState (epochStateStakeDistrL)
115115
import Control.DeepSeq (NFData (rnf), deepseq)
116116
import Data.Aeson (ToJSON (..), (.=))
@@ -568,7 +568,7 @@ data RatifyEnv era = RatifyEnv
568568
, reCurrentEpoch :: EpochNo
569569
, reCommitteeState :: CommitteeState era
570570
, reAccounts :: Accounts era
571-
, rePoolParams :: Map (KeyHash 'StakePool) PoolParams
571+
, reStakePoolParams :: Map (KeyHash 'StakePool) StakePoolParams
572572
}
573573
deriving (Generic)
574574

@@ -652,7 +652,7 @@ instance
652652
!> To reCurrentEpoch
653653
!> To reCommitteeState
654654
!> To reAccounts
655-
!> To rePoolParams
655+
!> To reStakePoolParams
656656

657657
instance
658658
(Era era, DecCBOR (InstantStake era), DecCBOR (Accounts era)) =>

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Cert.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ certTransition = do
220220
TRC (CertEnv pp currentEpoch committee committeeProposals, certState, c) <- judgmentContext
221221
let
222222
certPState = certState ^. certPStateL
223-
pools = psStakePoolParams certPState
223+
pools = psStakeStakePoolParams certPState
224224
case c of
225225
ConwayTxCertDeleg delegCert -> do
226226
trans @(EraRule "DELEG" era) $ TRC (ConwayDelegEnv pp pools, certState, delegCert)

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Deleg.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import Cardano.Ledger.Conway.TxCert (
5454
Delegatee (DelegStake, DelegStakeVote, DelegVote),
5555
)
5656
import Cardano.Ledger.Credential (Credential)
57-
import Cardano.Ledger.PoolParams (PoolParams)
57+
import Cardano.Ledger.PoolParams (StakePoolParams)
5858
import Control.DeepSeq (NFData)
5959
import Control.Monad (forM_, guard, unless)
6060
import Control.State.Transition (
@@ -83,7 +83,7 @@ import NoThunks.Class (NoThunks)
8383

8484
data ConwayDelegEnv era = ConwayDelegEnv
8585
{ cdePParams :: PParams era
86-
, cdePools :: Map (KeyHash 'StakePool) PoolParams
86+
, cdePools :: Map (KeyHash 'StakePool) StakePoolParams
8787
}
8888
deriving (Generic)
8989

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Epoch.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ epochTransition = do
302302
trans @(EraRule "SNAP" era) $ TRC (SnapEnv ledgerState0 curPParams, snapshots0, ())
303303

304304
-- Activate future StakePools
305-
let newStakePoolParams = eval (psStakePoolParams pState0 psFutureStakePoolParams pState0)
305+
let newStakeStakePoolParams = eval (psStakeStakePoolParams pState0 psFutureStakeStakePoolParams pState0)
306306
pState1 =
307307
pState0
308-
{ psStakePoolParams = newStakePoolParams
309-
, psFutureStakePoolParams = Map.empty
308+
{ psStakeStakePoolParams = newStakeStakePoolParams
309+
, psFutureStakeStakePoolParams = Map.empty
310310
}
311311
PoolreapState utxoState1 chainAccountState1 certState1 <-
312312
trans @(EraRule "POOLREAP" era) $

eras/conway/impl/src/Cardano/Ledger/Conway/Rules/Gov.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ govTransition = do
458458
certDState = certState ^. certDStateL
459459
committeeState = vsCommitteeState certVState
460460
knownDReps = vsDReps certVState
461-
knownStakePools = psStakePoolParams certPState
461+
knownStakePools = psStakeStakePoolParams certPState
462462
knownCommitteeMembers = authorizedHotCommitteeCredentials committeeState
463463

464464
expectedNetworkId <- liftSTS $ asks networkId

0 commit comments

Comments
 (0)