Skip to content

Commit 572ec83

Browse files
committed
WIP - RatifySpec
1 parent 7fe6e53 commit 572ec83

File tree

2 files changed

+16
-46
lines changed

2 files changed

+16
-46
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import qualified Test.Cardano.Ledger.Conway.Imp.EpochSpec as Epoch
4949
import qualified Test.Cardano.Ledger.Conway.Imp.GovCertSpec as GovCert
5050
import qualified Test.Cardano.Ledger.Conway.Imp.GovSpec as Gov
5151
import qualified Test.Cardano.Ledger.Conway.Imp.LedgerSpec as Ledger
52-
-- import qualified Test.Cardano.Ledger.Conway.Imp.RatifySpec as Ratify
52+
import qualified Test.Cardano.Ledger.Conway.Imp.RatifySpec as Ratify
5353
-- import qualified Test.Cardano.Ledger.Conway.Imp.UtxoSpec as Utxo
5454
-- import qualified Test.Cardano.Ledger.Conway.Imp.UtxosSpec as Utxos
5555
import Test.Cardano.Ledger.Conway.ImpTest (
@@ -137,7 +137,7 @@ conwaySpec = do
137137
describe "GOV" Gov.spec
138138
describe "GOVCERT" GovCert.spec
139139
describe "LEDGER" Ledger.spec
140+
describe "RATIFY" Ratify.spec
140141

141-
-- describe "RATIFY" Ratify.spec
142142
-- describe "UTXO" Utxo.spec
143143
-- describe "UTXOS" Utxos.spec

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

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ import Test.Cardano.Ledger.Imp.Common
3737

3838
spec ::
3939
forall era.
40-
( HasCallStack
41-
, ConwayEraImp era
42-
, ShelleyEraTxCert era
43-
) =>
40+
(HasCallStack, ConwayEraImp era) =>
4441
SpecWith (ImpInit (LedgerSpec era))
4542
spec = do
4643
votingSpec
@@ -72,10 +69,7 @@ spec = do
7269

7370
initiateHardForkWithLessThanMinimalCommitteeSize ::
7471
forall era.
75-
( HasCallStack
76-
, ConwayEraImp era
77-
, ShelleyEraTxCert era
78-
) =>
72+
(HasCallStack, ConwayEraImp era) =>
7973
SpecWith (ImpInit (LedgerSpec era))
8074
initiateHardForkWithLessThanMinimalCommitteeSize =
8175
it "Hard Fork can still be initiated with less than minimal committee size" $ do
@@ -103,10 +97,7 @@ initiateHardForkWithLessThanMinimalCommitteeSize =
10397

10498
spoAndCCVotingSpec ::
10599
forall era.
106-
( HasCallStack
107-
, ConwayEraImp era
108-
, ShelleyEraTxCert era
109-
) =>
100+
(HasCallStack, ConwayEraImp era) =>
110101
SpecWith (ImpInit (LedgerSpec era))
111102
spoAndCCVotingSpec = do
112103
describe "When CC expired" $ do
@@ -210,10 +201,7 @@ spoAndCCVotingSpec = do
210201

211202
committeeExpiryResignationDiscountSpec ::
212203
forall era.
213-
( HasCallStack
214-
, ConwayEraImp era
215-
, ShelleyEraTxCert era
216-
) =>
204+
(HasCallStack, ConwayEraImp era) =>
217205
SpecWith (ImpInit (LedgerSpec era))
218206
committeeExpiryResignationDiscountSpec =
219207
-- Committee-update proposals are disallowed during bootstrap, so we can only run these tests post-bootstrap
@@ -285,10 +273,7 @@ committeeExpiryResignationDiscountSpec =
285273

286274
paramChangeAffectsProposalsSpec ::
287275
forall era.
288-
( HasCallStack
289-
, ConwayEraImp era
290-
, ShelleyEraTxCert era
291-
) =>
276+
(HasCallStack, ConwayEraImp era) =>
292277
SpecWith (ImpInit (LedgerSpec era))
293278
paramChangeAffectsProposalsSpec =
294279
-- These tests rely on submitting committee-update proposals and on drep votes, which are disallowed during bootstrap,
@@ -466,17 +451,14 @@ paramChangeAffectsProposalsSpec =
466451

467452
committeeMinSizeAffectsInFlightProposalsSpec ::
468453
forall era.
469-
( HasCallStack
470-
, ConwayEraImp era
471-
, ShelleyEraTxCert era
472-
) =>
454+
(HasCallStack, ConwayEraImp era) =>
473455
SpecWith (ImpInit (LedgerSpec era))
474456
committeeMinSizeAffectsInFlightProposalsSpec =
475457
-- Treasury withdrawals are disallowed during bootstrap, so we can only run these tests post-bootstrap
476458
describe "CommitteeMinSize affects in-flight proposals" $ do
477459
let setCommitteeMinSize n = modifyPParams $ ppCommitteeMinSizeL .~ n
478460
submitTreasuryWithdrawal amount = do
479-
rewardAccount <- registerRewardAccount
461+
rewardAccount <- registerRewardAccountWithDeposit
480462
submitTreasuryWithdrawals [(rewardAccount, amount)]
481463
it "TreasuryWithdrawal fails to ratify due to an increase in CommitteeMinSize" $ whenPostBootstrap $ do
482464
disableTreasuryExpansion
@@ -536,10 +518,7 @@ committeeMinSizeAffectsInFlightProposalsSpec =
536518

537519
spoVotesForHardForkInitiation ::
538520
forall era.
539-
( HasCallStack
540-
, ConwayEraImp era
541-
, ShelleyEraTxCert era
542-
) =>
521+
(HasCallStack, ConwayEraImp era) =>
543522
SpecWith (ImpInit (LedgerSpec era))
544523
spoVotesForHardForkInitiation =
545524
describe "Counting of SPO votes" $ do
@@ -577,10 +556,7 @@ spoVotesForHardForkInitiation =
577556

578557
votingSpec ::
579558
forall era.
580-
( HasCallStack
581-
, ConwayEraImp era
582-
, ShelleyEraTxCert era
583-
) =>
559+
(HasCallStack, ConwayEraImp era) =>
584560
SpecWith (ImpInit (LedgerSpec era))
585561
votingSpec =
586562
describe "Voting" $ do
@@ -836,7 +812,7 @@ votingSpec =
836812
calculateDRepAcceptedRatio paramChangeGovId `shouldReturn` 1 % 2
837813

838814
kh <- freshKeyHash
839-
_ <- registerStakeCredential (KeyHashObj kh)
815+
_ <- registerStakeCredentialWithDeposit (KeyHashObj kh)
840816
_ <- delegateToDRep (KeyHashObj kh) (Coin 1_000_000) DRepAlwaysNoConfidence
841817
passEpoch
842818
-- AlwaysNoConfidence vote acts like a 'No' vote for actions other than NoConfidence
@@ -897,7 +873,7 @@ votingSpec =
897873

898874
(drep2, drep2Staking, _) <- setupSingleDRep 1_000_000
899875

900-
rewardAccount <- registerRewardAccount
876+
rewardAccount <- registerRewardAccountWithDeposit
901877
govId <- submitTreasuryWithdrawals [(rewardAccount, initialTreasury)]
902878

903879
submitYesVote_ (CommitteeVoter comMember) govId
@@ -925,7 +901,7 @@ votingSpec =
925901
& ppCoinsPerUTxOByteL .~ CoinPerByte (Coin 1)
926902
(drep, _, committeeId) <- electBasicCommittee
927903
kh <- freshKeyHash
928-
_ <- registerStakeCredential (KeyHashObj kh)
904+
_ <- registerStakeCredentialWithDeposit (KeyHashObj kh)
929905
_ <- delegateToDRep (KeyHashObj kh) (Coin 300) DRepAlwaysNoConfidence
930906
noConfidence <- submitGovAction (NoConfidence (SJust committeeId))
931907
submitYesVote_ (DRepVoter drep) noConfidence
@@ -1479,10 +1455,7 @@ votingSpec =
14791455

14801456
delayingActionsSpec ::
14811457
forall era.
1482-
( HasCallStack
1483-
, ConwayEraImp era
1484-
, ShelleyEraTxCert era
1485-
) =>
1458+
(HasCallStack, ConwayEraImp era) =>
14861459
SpecWith (ImpInit (LedgerSpec era))
14871460
delayingActionsSpec =
14881461
-- All tests below are relying on submitting constitution of committe-update proposals, which are disallowed during bootstrap,
@@ -1699,10 +1672,7 @@ delayingActionsSpec =
16991672

17001673
committeeMaxTermLengthSpec ::
17011674
forall era.
1702-
( HasCallStack
1703-
, ConwayEraImp era
1704-
, ShelleyEraTxCert era
1705-
) =>
1675+
(HasCallStack, ConwayEraImp era) =>
17061676
SpecWith (ImpInit (LedgerSpec era))
17071677
committeeMaxTermLengthSpec =
17081678
-- Committee-update proposals are disallowed during bootstrap, so we can only run these tests post-bootstrap

0 commit comments

Comments
 (0)