diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/GovSpec.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/GovSpec.hs index 7bd3c109e4a..9ae0bb8f94c 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/GovSpec.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/GovSpec.hs @@ -895,6 +895,32 @@ votingSpec = . constitutionAnchorL expectNoCurrentProposals conAnchor `shouldNotBe` anchor + it "VotersDoNotExist" $ do + pp <- getsNES $ nesEsL . curPParamsEpochStateL + let ProtVer major minor = pp ^. ppProtocolVersionL + gaId <- submitGovAction $ HardForkInitiation SNothing $ ProtVer major (succ minor) + hotCred <- KeyHashObj <$> freshKeyHash + submitFailingVote (CommitteeVoter hotCred) gaId $ + [injectFailure $ VotersDoNotExist [CommitteeVoter hotCred]] + poolId <- freshKeyHash + submitFailingVote (StakePoolVoter poolId) gaId $ + [injectFailure $ VotersDoNotExist [StakePoolVoter poolId]] + dRepCred <- KeyHashObj <$> freshKeyHash + whenPostBootstrap $ do + submitFailingVote (DRepVoter dRepCred) gaId $ + [injectFailure $ VotersDoNotExist [(DRepVoter dRepCred)]] + it "DRep votes are removed" $ do + pp <- getsNES $ nesEsL . curPParamsEpochStateL + let ProtVer major minor = pp ^. ppProtocolVersionL + gaId <- submitGovAction $ HardForkInitiation SNothing $ ProtVer major (succ minor) + dRepCred <- KeyHashObj <$> registerDRep + submitVote_ VoteNo (DRepVoter dRepCred) gaId + gas <- getGovActionState gaId + gasDRepVotes gas `shouldBe` [(dRepCred, VoteNo)] + let deposit = pp ^. ppDRepDepositL + submitTx_ $ mkBasicTx (mkBasicTxBody & certsTxBodyL .~ [UnRegDRepTxCert dRepCred deposit]) + gasAfterRemoval <- getGovActionState gaId + gasDRepVotes gasAfterRemoval `shouldBe` [] constitutionSpec :: forall era.