Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back couple of Imp tests that check SPO voting #4727

Closed
lehins opened this issue Oct 28, 2024 · 0 comments · Fixed by #4700
Closed

Bring back couple of Imp tests that check SPO voting #4727

lehins opened this issue Oct 28, 2024 · 0 comments · Fixed by #4700
Assignees

Comments

@lehins
Copy link
Collaborator

lehins commented Oct 28, 2024

The test removed in #4713 was unclear because it evolved from a more clear test into something that expected to be tested in bootstrap and after bootstrap.

If I remember correctly this test(s) where suppose to check SPOs voting.

Instead of removing tests it would be better to adjust them to make them work in the new re-organized imp spec. I'd suggest one of them to run in the post-bootsrap only, while the other switching to using a different action, like PParamUpdate.

Originally posted by @lehins in #4713 (comment)

So, this ticket is about bringing those tests back, but with more sensible semantics:

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" $ 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
        whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL .~ def)
        gai <- submitGovAction $ NoConfidence SNothing
        -- bootstrap: 1 % 4 stake yes; 3 % 4 stake abstain; yes / stake - abstain > 1 % 2
        -- post-bootstrap: 1 % 4 stake yes; 3 % 4 stake no; yes stake < 1 % 2
        submitYesVote_ (StakePoolVoter spoK1) gai
        passNEpochs 2
        pv <- getProtVer
        if bootstrapPhase pv
          then getLastEnactedCommittee `shouldReturn` SJust (GovPurposeId gai)
          else getLastEnactedCommittee `shouldReturn` SNothing
      it "CommitteeUpdate" $ 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
        whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL .~ def)
        cc <- KeyHashObj <$> freshKeyHash
        gai <- submitUpdateCommittee Nothing mempty [(cc, EpochInterval 5)] (1 %! 2)
        -- bootstrap: 1 % 4 stake yes; 3 % 4 stake abstain; yes / stake - abstain > 1 % 2
        -- post-bootstrap: 1 % 4 stake yes; 3 % 4 stake no; yes stake < 1 % 2
        submitYesVote_ (StakePoolVoter spoK1) gai
        passNEpochs 2
        pv <- getProtVer
        if bootstrapPhase pv
          then getLastEnactedCommittee `shouldReturn` SJust (GovPurposeId gai)
          else getLastEnactedCommittee `shouldReturn` SNothing
Lucsanszky added a commit that referenced this issue Nov 2, 2024
This reverts commit c051f13 and
adjusts the test.

Resolves #4727
@Lucsanszky Lucsanszky mentioned this issue Nov 2, 2024
9 tasks
Lucsanszky added a commit that referenced this issue Nov 5, 2024
This reverts commit c051f13 and
adjusts the test.

Resolves #4727
Lucsanszky added a commit that referenced this issue Nov 5, 2024
This reverts commit c051f13 and
adjusts the test.

Resolves #4727
Lucsanszky added a commit that referenced this issue Nov 12, 2024
This reverts commit c051f13 and
adjusts the test.

Resolves #4727
Lucsanszky added a commit that referenced this issue Nov 14, 2024
Test SPO vote counting

Follow-up for #4659
Resolves #4617, #4727
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants