Skip to content

Commit 6a7cdc6

Browse files
committed
WIP
1 parent 19923f2 commit 6a7cdc6

File tree

2 files changed

+38
-1
lines changed
  • eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp
  • libs/cardano-ledger-conformance/test/Test/Cardano/Ledger/Conformance

2 files changed

+38
-1
lines changed

eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/RatifySpec.hs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,43 @@ spoAndCCVotingSpec = do
143143

144144
getLastEnactedParameterChange `shouldReturn` SNothing
145145
getsPParams ppMinFeeRefScriptCostPerByteL `shouldReturn` initialRefScriptBaseFee
146+
it "Constitution cannot be changed if thresholds are at zero" . whenPostBootstrap $ do
147+
modifyPParams $ \pp ->
148+
pp
149+
& ppDRepVotingThresholdsL . dvtUpdateToConstitutionL .~ (0 %! 1)
150+
& ppCommitteeMinSizeL .~ 2
151+
& ppCommitteeMaxTermLengthL .~ EpochInterval 50
152+
coldCommitteeActive <- KeyHashObj <$> freshKeyHash
153+
coldCommitteeInactive <- KeyHashObj <$> freshKeyHash
154+
startingEpoch <- getsNES nesELL
155+
maxTermLength <- getsPParams ppCommitteeMaxTermLengthL
156+
(dRep, _, _) <- setupSingleDRep 1_000_000_000
157+
(spo, _, _) <- setupPoolWithStake $ Coin 1_000_000_000
158+
let
159+
committeeMap =
160+
[ (coldCommitteeActive, addEpochInterval startingEpoch maxTermLength)
161+
, (coldCommitteeInactive, addEpochInterval startingEpoch $ EpochInterval 5)
162+
]
163+
initialCommittee <- getCommitteeMembers
164+
committeeActionId <-
165+
impAnn "Submit committee update"
166+
. submitGovAction
167+
$ UpdateCommittee
168+
SNothing
169+
initialCommittee
170+
committeeMap
171+
(0 %! 1)
172+
submitYesVote_ (DRepVoter dRep) committeeActionId
173+
submitYesVote_ (StakePoolVoter spo) committeeActionId
174+
passNEpochs 2
175+
getCommitteeMembers `shouldReturn` Map.keysSet committeeMap
176+
passNEpochs 3
177+
newConstitution <- arbitrary
178+
constitutionActionId <- submitGovAction $ NewConstitution SNothing newConstitution
179+
logRatificationChecks constitutionActionId
180+
passNEpochs 2
181+
getConstitution `shouldNotReturn` newConstitution
182+
True `shouldBe` False
146183
describe "When CC threshold is 0" $ do
147184
-- During the bootstrap phase, proposals that modify the committee are not allowed,
148185
-- hence we need to directly set the threshold for the initial members

libs/cardano-ledger-conformance/test/Test/Cardano/Ledger/Conformance/Imp.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,6 @@ spec =
156156
-- LEDGER tests pending on the dRep delegations cleanup in the spec:
157157
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/635
158158
xdescribe "LEDGER" Ledger.spec
159-
xdescribe "RATIFY" Ratify.spec
159+
describe "RATIFY" Ratify.spec
160160
xdescribe "UTXO" Utxo.spec
161161
xdescribe "UTXOS" Utxos.spec

0 commit comments

Comments
 (0)