From 4510227c308b3cea75e48d15d13c79e5e13292b6 Mon Sep 17 00:00:00 2001 From: Alexey Kuleshevich Date: Fri, 28 Jun 2024 13:27:31 -0600 Subject: [PATCH] Add a test case for many cold keys mapping to one hot key --- .../Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs index 39069d8cadc..d674b2d13ea 100644 --- a/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs +++ b/eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs @@ -945,6 +945,22 @@ votingSpec = passNEpochs 2 -- The same vote should now successfully ratify the proposal getLastEnactedCommittee `shouldReturn` SJust (GovPurposeId addCCGaid) + it "Many CC Cold Credentials map to the same Hot Credential act as many votes" $ do + hotCred NE.:| _ <- registerInitialCommittee + (dRep, _, _) <- setupSingleDRep . getPositive =<< arbitrary + Positive deposit <- arbitrary + gaId <- submitParameterChange SNothing $ def & ppuDRepDepositL .~ SJust (Coin deposit) + submitYesVote_ (CommitteeVoter hotCred) gaId + whenPostBootstrap $ submitYesVote_ (DRepVoter dRep) gaId + passNEpochs 2 + getLastEnactedParameterChange `shouldReturn` SNothing + -- Make sure all committee members authorize the same hot credential that just voted: + committeeMembers' <- Set.toList <$> getCommitteeMembers + case committeeMembers' of + x : xs -> void $ registerCommitteeHotKeys (pure hotCred) $ x NE.:| xs + _ -> error "Expected an initial committee" + passNEpochs 2 + getLastEnactedParameterChange `shouldReturn` SJust (GovPurposeId gaId) delayingActionsSpec :: forall era.