Skip to content

Commit

Permalink
Merge pull request #4829 from IntersectMBO/aniketd/conformance-enact
Browse files Browse the repository at this point in the history
Enable imp-conformance for ENACT
  • Loading branch information
lehins authored Jan 24, 2025
2 parents 3c58ced + e7ba425 commit a45b1b3
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 64 deletions.
133 changes: 70 additions & 63 deletions eras/conway/impl/testlib/Test/Cardano/Ledger/Conway/Imp/EnactSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -466,72 +466,79 @@ actionPrioritySpec =
<$> uniformRM (30, 330)
<*> uniformRM (330, 660)
<*> uniformRM (660, 1000)
it "proposals of same priority are enacted in order of submission" $ do
modifyPParams $ ppPoolVotingThresholdsL . pvtPPSecurityGroupL .~ 1 %! 1
whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL . dvtPPEconomicGroupL .~ def)
(val1, val2, val3) <- genMinFeeVals

committeeCs <- registerInitialCommittee
(spoC, _, _) <- setupPoolWithStake $ Coin 42_000_000
pGai0 <-
submitParameterChange
SNothing
$ def & ppuMinFeeAL .~ SJust val1
pGai1 <-
submitParameterChange
(SJust pGai0)
$ def & ppuMinFeeAL .~ SJust val2
pGai2 <-
submitParameterChange
(SJust pGai1)
$ def & ppuMinFeeAL .~ SJust val3
traverse_ @[]
( \gaid -> do
submitYesVote_ (StakePoolVoter spoC) gaid
submitYesVoteCCs_ committeeCs gaid
)
[pGai0, pGai1, pGai2]
passNEpochs 2
getLastEnactedParameterChange
`shouldReturn` SJust (GovPurposeId pGai2)
expectNoCurrentProposals
getsNES (nesEsL . curPParamsEpochStateL . ppMinFeeAL)
`shouldReturn` val3
disableImpInitExpectLedgerRuleConformance $
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/642
-- TODO: Remove this override once the issue is fixed
it "proposals of same priority are enacted in order of submission" $ do
modifyPParams $ ppPoolVotingThresholdsL . pvtPPSecurityGroupL .~ 1 %! 1
whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL . dvtPPEconomicGroupL .~ def)
(val1, val2, val3) <- genMinFeeVals

it "only the first action of a transaction gets enacted" $ do
modifyPParams $ ppPoolVotingThresholdsL . pvtPPSecurityGroupL .~ 1 %! 1
whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL . dvtPPEconomicGroupL .~ def)
(val1, val2, val3) <- genMinFeeVals
committeeCs <- registerInitialCommittee
(spoC, _, _) <- setupPoolWithStake $ Coin 42_000_000
pGai0 <-
submitParameterChange
SNothing
$ def & ppuMinFeeAL .~ SJust val1
pGai1 <-
submitParameterChange
(SJust pGai0)
$ def & ppuMinFeeAL .~ SJust val2
pGai2 <-
submitParameterChange
(SJust pGai1)
$ def & ppuMinFeeAL .~ SJust val3
traverse_ @[]
( \gaid -> do
submitYesVote_ (StakePoolVoter spoC) gaid
submitYesVoteCCs_ committeeCs gaid
)
[pGai0, pGai1, pGai2]
passNEpochs 2
getLastEnactedParameterChange
`shouldReturn` SJust (GovPurposeId pGai2)
expectNoCurrentProposals
getsNES (nesEsL . curPParamsEpochStateL . ppMinFeeAL)
`shouldReturn` val3

committeeCs <- registerInitialCommittee
(spoC, _, _) <- setupPoolWithStake $ Coin 42_000_000
policy <- getGovPolicy
gaids <-
submitGovActions $
NE.fromList
[ ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val1)
policy
, ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val2)
policy
, ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val3)
policy
]
traverse_
( \gaid -> do
submitYesVote_ (StakePoolVoter spoC) gaid
submitYesVoteCCs_ committeeCs gaid
)
gaids
passNEpochs 2
getsNES (nesEsL . curPParamsEpochStateL . ppMinFeeAL)
`shouldReturn` val1
expectNoCurrentProposals
disableImpInitExpectLedgerRuleConformance $
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/642
-- TODO: Remove this override once the issue is fixed
it "only the first action of a transaction gets enacted" $ do
modifyPParams $ ppPoolVotingThresholdsL . pvtPPSecurityGroupL .~ 1 %! 1
whenPostBootstrap (modifyPParams $ ppDRepVotingThresholdsL . dvtPPEconomicGroupL .~ def)
(val1, val2, val3) <- genMinFeeVals

committeeCs <- registerInitialCommittee
(spoC, _, _) <- setupPoolWithStake $ Coin 42_000_000
policy <- getGovPolicy
gaids <-
submitGovActions $
NE.fromList
[ ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val1)
policy
, ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val2)
policy
, ParameterChange
SNothing
(def & ppuMinFeeAL .~ SJust val3)
policy
]
traverse_
( \gaid -> do
submitYesVote_ (StakePoolVoter spoC) gaid
submitYesVoteCCs_ committeeCs gaid
)
gaids
passNEpochs 2
getsNES (nesEsL . curPParamsEpochStateL . ppMinFeeAL)
`shouldReturn` val1
expectNoCurrentProposals

expectHardForkEvents ::
forall era.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ spec =
describe "BBODY" Bbody.spec
describe "CERTS" Certs.spec
describe "DELEG" Deleg.spec
xdescribe "ENACT" Enact.spec
describe "ENACT" Enact.spec
xdescribe "EPOCH" Epoch.spec
xdescribe "GOV" Gov.spec
describe "GOVCERT" GovCert.spec
Expand Down

0 comments on commit a45b1b3

Please sign in to comment.