Skip to content

Commit

Permalink
Reinstate and adjust spoVotesCommitteeUpdates
Browse files Browse the repository at this point in the history
This reverts commit c051f13 and
adjusts the test.

Resolves #4727
  • Loading branch information
Lucsanszky committed Nov 5, 2024
1 parent f36bd5f commit b0bc17c
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec ::
spec = do
votingSpec
delayingActionsSpec
spoVotesCommitteeUpdates
committeeMinSizeAffectsInFlightProposalsSpec
paramChangeAffectsProposalsSpec
committeeExpiryResignationDiscountSpec
Expand Down Expand Up @@ -510,6 +511,39 @@ committeeMinSizeAffectsInFlightProposalsSpec =
passNEpochs 2
getsNES (nesEsL . esAccountStateL . asTreasuryL) `shouldReturn` (treasury <-> amount)

spoVotesCommitteeUpdates ::
forall era.
ConwayEraImp era =>
SpecWith (ImpTestState era)
spoVotesCommitteeUpdates =
describe "Counting of SPO votes" $ do
describe "All gov action other than HardForkInitiation" $ do
it "NoConfidence" $ whenPostBootstrap $ do
(spoK1, _, _) <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
modifyPParams $ ppPoolVotingThresholdsL . pvtMotionNoConfidenceL .~ 1 %! 2
modifyPParams $ ppDRepVotingThresholdsL .~ def
gai <- submitGovAction $ NoConfidence SNothing
-- 1 % 4 stake yes; 3 % 4 stake no; yes stake < 1 % 2
submitYesVote_ (StakePoolVoter spoK1) gai
passNEpochs 2
getLastEnactedCommittee `shouldReturn` SNothing
it "CommitteeUpdate" $ whenPostBootstrap $ do
(spoK1, _, _) <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
_ <- setupPoolWithStake $ Coin 100_000_000
modifyPParams $ ppPoolVotingThresholdsL . pvtCommitteeNormalL .~ 1 %! 2
modifyPParams $ ppDRepVotingThresholdsL .~ def
cc <- KeyHashObj <$> freshKeyHash
gai <- submitUpdateCommittee Nothing mempty [(cc, EpochInterval 5)] (1 %! 2)
-- 1 % 4 stake yes; 3 % 4 stake no; yes stake < 1 % 2
submitYesVote_ (StakePoolVoter spoK1) gai
passNEpochs 2
getLastEnactedCommittee `shouldReturn` SNothing

spoVotesForHardForkInitiation ::
forall era.
ConwayEraImp era =>
Expand Down

0 comments on commit b0bc17c

Please sign in to comment.