Skip to content

Commit

Permalink
Add missing drep voting thresholds lenses in PParams
Browse files Browse the repository at this point in the history
  • Loading branch information
teodanciu committed Apr 29, 2024
1 parent 9db2a4d commit 4d71f61
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
4 changes: 4 additions & 0 deletions eras/conway/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 1.14.0 0

* Add lenses:
* `dvtHardForkInitiationL`
* `dvtMotionNoConfidenceL`
* `dvtTreasuryWithdrawalL`
* Add`DisallowedProposalDuringBootstrap` and `DisallowedVotesDuringBootstrap` to `ConwayGovPredFailure`
* Make `DRepDistr` calculation include rewards when no UTxO stake is delegated. #4273
* Rename `computeDrepPulser` to `computeDRepPulser`.
Expand Down
12 changes: 12 additions & 0 deletions eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ module Cardano.Ledger.Conway.PParams (
DRepVotingThresholds (..),
dvtCommitteeNoConfidenceL,
dvtCommitteeNormalL,
dvtHardForkInitiationL,
dvtMotionNoConfidenceL,
dvtPPNetworkGroupL,
dvtPPGovGroupL,
dvtPPTechnicalGroupL,
dvtPPEconomicGroupL,
dvtTreasuryWithdrawalL,
dvtUpdateToConstitutionL,
ConwayPParams (..),
getLanguageView,
Expand Down Expand Up @@ -361,6 +364,15 @@ dvtCommitteeNoConfidenceL = lens dvtCommitteeNoConfidence (\x y -> x {dvtCommitt
dvtCommitteeNormalL :: Lens' DRepVotingThresholds UnitInterval
dvtCommitteeNormalL = lens dvtCommitteeNormal (\x y -> x {dvtCommitteeNormal = y})

dvtMotionNoConfidenceL :: Lens' DRepVotingThresholds UnitInterval
dvtMotionNoConfidenceL = lens dvtMotionNoConfidence (\x y -> x {dvtMotionNoConfidence = y})

dvtHardForkInitiationL :: Lens' DRepVotingThresholds UnitInterval
dvtHardForkInitiationL = lens dvtHardForkInitiation (\x y -> x {dvtHardForkInitiation = y})

dvtTreasuryWithdrawalL :: Lens' DRepVotingThresholds UnitInterval
dvtTreasuryWithdrawalL = lens dvtTreasuryWithdrawal (\x y -> x {dvtTreasuryWithdrawal = y})

instance EncCBOR DRepVotingThresholds where
encCBOR DRepVotingThresholds {..} =
encodeListLen 10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,20 +187,9 @@ hardForkInitiationSpec =
(committeeMember :| _) <- registerInitialCommittee
modifyPParams $ \pp ->
pp
& ppDRepVotingThresholdsL
%~ ( \dvt ->
dvt
{ dvtHardForkInitiation = 2 %! 3
}
)
& ppPoolVotingThresholdsL
%~ ( \pvt ->
pvt
{ pvtHardForkInitiation = 2 %! 3
}
)
& ppGovActionLifetimeL
.~ EpochInterval 20
& ppDRepVotingThresholdsL . dvtHardForkInitiationL .~ 2 %! 3
& ppPoolVotingThresholdsL . pvtHardForkInitiationL .~ 2 %! 3
& ppGovActionLifetimeL .~ EpochInterval 20
_ <- setupPoolWithStake $ Coin 22_000_000
(stakePoolId1, _, _) <- setupPoolWithStake $ Coin 22_000_000
(stakePoolId2, _, _) <- setupPoolWithStake $ Coin 22_000_000
Expand Down

0 comments on commit 4d71f61

Please sign in to comment.