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 18, 2024
1 parent 153555a commit 7f3421e
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
Expand Up @@ -2,6 +2,10 @@

## 1.14.0 0

* Add lenses:
* `dvtHardForkInitiationL`
* `dvtMotionNoConfidenceL`
* `dvtTreasuryWithdrawalL`
* Add`DisallowedProposalDuringBootstrap` and `DisallowedVotesDuringBootstrap` to `ConwayGovPredFailure`
* Add `ucppPlutusV3CostModel` to `UpgradeConwayPParams`. #4252
* Remove the `Default` instance for `ConwayGenesis`.
Expand Down
12 changes: 12 additions & 0 deletions eras/conway/impl/src/Cardano/Ledger/Conway/PParams.hs
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
Expand Up @@ -186,20 +186,9 @@ hardForkInitiationSpec =
(_, committeeMember, _) <- electBasicCommittee
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 7f3421e

Please sign in to comment.