Skip to content

Commit 85c9912

Browse files
committed
Bumped spec
1 parent 688430f commit 85c9912

File tree

7 files changed

+33
-6
lines changed

7 files changed

+33
-6
lines changed

cabal.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ source-repository-package
2424
-- !WARNING!:
2525
-- MAKE SURE THIS POINTS TO A COMMIT IN `MAlonzo-code` BEFORE MERGE!
2626
subdir: generated
27-
--sha256: sha256-fzvk/UcLDZbC+pe9K6gao8JQ/al+L+KdzyPxAaL1xiM=
28-
tag: 098ebf75fc06635bf0a38a82f4086bbd840af7c0
27+
--sha256: sha256-CebCHTM0lvIAJ5lx0LRcMEDeU4nGVWJlkvhJPE5tI9Y=
28+
tag: 0f9eb79886f4d45a2cbb241af49b9e199735bd37
2929

3030
-- NOTE: If you would like to update the above, look for the `MAlonzo-code`
3131
-- branch in the `formal-ledger-specifications` repo and copy the SHA of

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,14 @@ spec = do
159159
submitFailingTx
160160
registerHotKeyTx
161161
(pure . injectFailure $ ConwayCommitteeHasPreviouslyResigned ccCred)
162+
it "resigning a nonexistent CC member hotkey" $ do
163+
void registerInitialCommittee
164+
nonExistentColdKey <- KeyHashObj <$> freshKeyHash
165+
let failingTx =
166+
mkBasicTx mkBasicTxBody
167+
& bodyTxL . certsTxBodyL
168+
.~ SSeq.singleton (ResignCommitteeColdTxCert nonExistentColdKey SNothing)
169+
submitFailingTx
170+
failingTx
171+
[ injectFailure $ ConwayCommitteeIsUnknown nonExistentColdKey
172+
]

libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Cert.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import Cardano.Ledger.EpochBoundary
2525
import Cardano.Ledger.Shelley.LedgerState
2626
import qualified Data.Foldable as Set
2727
import Data.Functor.Identity (Identity)
28-
import Data.Map.Strict (Map)
28+
import Data.Map.Strict (Map, keysSet)
2929
import qualified Data.VMap as VMap
3030
import Lens.Micro
3131
import qualified Lib as Agda
@@ -49,11 +49,13 @@ instance
4949
toSpecRep CertEnv {..} = do
5050
votes <- askCtx @(VotingProcedures era)
5151
withdrawals <- askCtx @(Map RewardAccount Coin)
52+
let ccColdCreds = foldMap (keysSet . committeeMembers) ceCurrentCommittee
5253
Agda.MkCertEnv
5354
<$> toSpecRep ceCurrentEpoch
5455
<*> toSpecRep cePParams
5556
<*> toSpecRep votes
5657
<*> toSpecRep withdrawals
58+
<*> toSpecRep ccColdCreds
5759

5860
instance SpecTranslate ctx (CertState era) where
5961
type SpecRep (CertState era) = Agda.CertState

libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Certs.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Cardano.Ledger.Conway.Core
1919
import Cardano.Ledger.Conway.Governance
2020
import Cardano.Ledger.Conway.Rules
2121
import Data.Functor.Identity (Identity)
22+
import Data.Map (keysSet)
2223
import Data.Map.Strict (Map)
2324
import qualified Lib as Agda
2425
import Test.Cardano.Ledger.Conformance
@@ -42,8 +43,10 @@ instance
4243
toSpecRep CertsEnv {..} = do
4344
votes <- askCtx @(VotingProcedures era)
4445
withdrawals <- askCtx @(Map RewardAccount Coin)
46+
let ccColdCreds = foldMap (keysSet . committeeMembers) certsCurrentCommittee
4547
Agda.MkCertEnv
4648
<$> toSpecRep certsCurrentEpoch
4749
<*> toSpecRep certsPParams
4850
<*> toSpecRep votes
4951
<*> toSpecRep withdrawals
52+
<*> toSpecRep ccColdCreds

libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/Deleg.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ instance SpecTranslate ctx ConwayDelegCert where
6262
toSpecRep (ConwayUnRegCert c d) =
6363
Agda.Dereg
6464
<$> toSpecRep c
65-
<*> strictMaybe (pure 0) toSpecRep d
65+
<*> toSpecRep d
6666
toSpecRep (ConwayDelegCert c d) =
6767
Agda.Delegate
6868
<$> toSpecRep c

libs/cardano-ledger-conformance/src/Test/Cardano/Ledger/Conformance/SpecTranslate/Conway/GovCert.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ import Cardano.Ledger.Credential (Credential (..))
3333
import Cardano.Ledger.Shelley.LedgerState
3434
import Data.Default (Default (..))
3535
import Data.Functor.Identity (Identity)
36-
import Data.Map.Strict (Map)
36+
import Data.Map.Strict (Map, keysSet)
3737
import qualified Data.Map.Strict as Map
38+
import Data.Maybe (mapMaybe)
3839
import qualified Lib as Agda
3940
import Test.Cardano.Ledger.Conformance.SpecTranslate.Conway.Base
4041
import Test.Cardano.Ledger.Conformance.SpecTranslate.Core
@@ -78,11 +79,21 @@ instance
7879
toSpecRep ConwayGovCertEnv {..} = do
7980
votes <- askCtx @(VotingProcedures era)
8081
withdrawals <- askCtx @(Map RewardAccount Coin)
82+
let propGetCCMembers (UpdateCommittee _ _ x _) = Just $ keysSet x
83+
propGetCCMembers _ = Nothing
84+
potentialCCMembers =
85+
mconcat
86+
. mapMaybe (propGetCCMembers . pProcGovAction . gasProposalProcedure)
87+
. Map.elems
88+
ccColdCreds =
89+
foldMap (keysSet . committeeMembers) cgceCurrentCommittee
90+
<> potentialCCMembers cgceCommitteeProposals
8191
Agda.MkCertEnv
8292
<$> toSpecRep cgceCurrentEpoch
8393
<*> toSpecRep cgcePParams
8494
<*> toSpecRep votes
8595
<*> toSpecRep withdrawals
96+
<*> toSpecRep ccColdCreds
8697

8798
instance SpecTranslate ctx (ConwayGovCertPredFailure era) where
8899
type SpecRep (ConwayGovCertPredFailure era) = OpaqueErrorString

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
@@ -160,7 +160,7 @@ spec =
160160
-- GOVCERT tests enabling pending on these two issues in spec:
161161
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/634
162162
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/633
163-
xdescribe "GOVCERT" GovCert.spec
163+
describe "GOVCERT" GovCert.spec
164164
-- LEDGER tests enabling pending (at least) on the implementation of scriptSize in the spec:
165165
-- https://github.com/IntersectMBO/formal-ledger-specifications/issues/620
166166
xdescribe "LEDGER" Ledger.spec

0 commit comments

Comments
 (0)