@@ -67,10 +67,7 @@ import Cardano.Ledger.Shelley.LedgerState (
6767 EpochState (.. ),
6868 LedgerState (.. ),
6969 UTxOState (.. ),
70- asTreasuryL ,
7170 curPParamsEpochStateL ,
72- esAccountState ,
73- esAccountStateL ,
7471 esLStateL ,
7572 esSnapshotsL ,
7673 lsCertStateL ,
@@ -228,23 +225,23 @@ updateNumDormantEpochs currentEpoch ps vState =
228225--
229226-- The utxo fees and donations are applied in the remaining body of EPOCH transition
230227applyEnactedWithdrawals ::
231- AccountState ->
228+ ChainAccountState ->
232229 DState era ->
233230 EnactState era ->
234- (AccountState , DState era , EnactState era )
235- applyEnactedWithdrawals accountState dState enactedState =
231+ (ChainAccountState , DState era , EnactState era )
232+ applyEnactedWithdrawals chainAccountState dState enactedState =
236233 let enactedWithdrawals = enactedState ^. ensWithdrawalsL
237234 rewardsUView = RewDepUView $ dState ^. dsUnifiedL
238235 successfulWithdrawls = rewardsUView ◁ enactedWithdrawals
239- accountState ' =
240- accountState
236+ chainAccountState ' =
237+ chainAccountState
241238 -- Subtract `successfulWithdrawals` from the treasury, and add them to the rewards UMap
242239 -- `unclaimed` withdrawals remain in the treasury.
243240 -- Compared to the spec, instead of adding `unclaimed` and subtracting `totWithdrawals`
244241 -- + unclaimed - totWithdrawals
245242 -- we just subtract the `refunds`
246243 -- - refunds
247- & asTreasuryL %~ (<-> fold successfulWithdrawls)
244+ & casTreasuryL %~ (<-> fold successfulWithdrawls)
248245 -- The use of the partial function `compactCoinOrError` is justified here because
249246 -- 1. the decoder for coin at the proposal-submission boundary has already
250247 -- confirmed we have a compactible value
@@ -258,7 +255,7 @@ applyEnactedWithdrawals accountState dState enactedState =
258255 enactedState
259256 & ensWithdrawalsL .~ Map. empty
260257 & ensTreasuryL .~ mempty
261- in (accountState ', dState', enactedState')
258+ in (chainAccountState ', dState', enactedState')
262259
263260epochTransition ::
264261 forall era .
@@ -291,14 +288,14 @@ epochTransition = do
291288 TRC
292289 ( ()
293290 , epochState0@ EpochState
294- { esAccountState = accountState0
295- , esSnapshots = snapshots0
291+ { esSnapshots = snapshots0
296292 , esLState = ledgerState0
297293 }
298294 , eNo
299295 ) <-
300296 judgmentContext
301- let govState0 = utxosGovState utxoState0
297+ let chainAccountState0 = epochState0 ^. chainAccountStateL
298+ govState0 = utxosGovState utxoState0
302299 curPParams = govState0 ^. curPParamsGovStateL
303300 utxoState0 = lsUTxOState ledgerState0
304301 certState0 = ledgerState0 ^. lsCertStateL
@@ -314,9 +311,9 @@ epochTransition = do
314311 { psStakePoolParams = newStakePoolParams
315312 , psFutureStakePoolParams = Map. empty
316313 }
317- PoolreapState utxoState1 accountState1 certState1 <-
314+ PoolreapState utxoState1 chainAccountState1 certState1 <-
318315 trans @ (EraRule " POOLREAP" era ) $
319- TRC (() , PoolreapState utxoState0 accountState0 (certState0 & certPStateL .~ pState1), eNo)
316+ TRC (() , PoolreapState utxoState0 chainAccountState0 (certState0 & certPStateL .~ pState1), eNo)
320317
321318 let
322319 stakePoolDistr = ssStakeMarkPoolDistr snapshots1
@@ -325,8 +322,8 @@ epochTransition = do
325322 ratifyState@ RatifyState {rsEnactState, rsEnacted, rsExpired} =
326323 extractDRepPulsingState pulsingState
327324
328- (accountState2 , dState2, EnactState {.. }) =
329- applyEnactedWithdrawals accountState1 (certState1 ^. certDStateL) rsEnactState
325+ (chainAccountState2 , dState2, EnactState {.. }) =
326+ applyEnactedWithdrawals chainAccountState1 (certState1 ^. certDStateL) rsEnactState
330327
331328 -- NOTE: It is important that we apply the results of ratification
332329 -- and enactment from the pulser to the working copy of proposals.
@@ -375,10 +372,10 @@ epochTransition = do
375372 )
376373 (certState1 ^. certPStateL)
377374 (dState2 & dsUnifiedL .~ newUMap)
378- accountState3 =
379- accountState2
375+ chainAccountState3 =
376+ chainAccountState2
380377 -- Move donations and unclaimed rewards from proposals to treasury:
381- & asTreasuryL <>~ (utxoState0 ^. utxosDonationL <> fold unclaimed)
378+ & casTreasuryL <>~ (utxoState0 ^. utxosDonationL <> fold unclaimed)
382379 utxoState2 =
383380 utxoState1
384381 & utxosDepositedL .~ totalObligation certState2 govState1
@@ -391,7 +388,7 @@ epochTransition = do
391388 & lsUTxOStateL .~ utxoState2
392389 epochState1 =
393390 epochState0
394- & esAccountStateL .~ accountState3
391+ & chainAccountStateL .~ chainAccountState3
395392 & esSnapshotsL .~ snapshots1
396393 & esLStateL .~ ledgerState1
397394 tellEvent $ EpochBoundaryRatifyState ratifyState
0 commit comments