Skip to content

Commit

Permalink
Rename ConwayReg/UnReg CommitteeHotKey to Auth and Resign
Browse files Browse the repository at this point in the history
respectively
  • Loading branch information
teodanciu committed Jun 2, 2023
1 parent 58b4f4c commit a75752d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions eras/conway/impl/src/Cardano/Ledger/Conway/TxCert.hs
Expand Up @@ -159,12 +159,12 @@ instance Crypto c => ConwayEraTxCert (ConwayEra c) where
getRegDepositDelegTxCert (ConwayTxCertDeleg (ConwayRegDelegCert cred d c)) = Just (cred, d, c)
getRegDepositDelegTxCert _ = Nothing

mkRegCommitteeHotTxCert ck hk = ConwayTxCertCommittee $ ConwayRegCommitteeHotKey ck hk
getRegCommitteeHotTxCert (ConwayTxCertCommittee (ConwayRegCommitteeHotKey ck hk)) = Just (ck, hk)
mkRegCommitteeHotTxCert ck hk = ConwayTxCertCommittee $ ConwayAuthCommitteeHotKey ck hk
getRegCommitteeHotTxCert (ConwayTxCertCommittee (ConwayAuthCommitteeHotKey ck hk)) = Just (ck, hk)
getRegCommitteeHotTxCert _ = Nothing

mkUnRegCommitteeHotTxCert = ConwayTxCertCommittee . ConwayUnRegCommitteeHotKey
getUnRegCommitteeHotTxCert (ConwayTxCertCommittee (ConwayUnRegCommitteeHotKey ck)) = Just ck
mkUnRegCommitteeHotTxCert = ConwayTxCertCommittee . ConwayResignCommitteeColdKey
getUnRegCommitteeHotTxCert (ConwayTxCertCommittee (ConwayResignCommitteeColdKey ck)) = Just ck
getUnRegCommitteeHotTxCert _ = Nothing

pattern RegDepositTxCert ::
Expand Down Expand Up @@ -277,8 +277,8 @@ instance NFData (ConwayDelegCert c)
instance NoThunks (ConwayDelegCert c)

data ConwayCommitteeCert c
= ConwayRegCommitteeHotKey !(KeyHash 'CommitteeColdKey c) !(KeyHash 'CommitteeHotKey c)
| ConwayUnRegCommitteeHotKey !(KeyHash 'CommitteeColdKey c)
= ConwayAuthCommitteeHotKey !(KeyHash 'CommitteeColdKey c) !(KeyHash 'CommitteeHotKey c)
| ConwayResignCommitteeColdKey !(KeyHash 'CommitteeColdKey c)
deriving (Show, Generic, Eq)

instance NFData (ConwayCommitteeCert c)
Expand All @@ -287,8 +287,8 @@ instance NoThunks (ConwayCommitteeCert c)

committeeKeyHashWitness :: ConwayCommitteeCert c -> KeyHash 'Witness c
committeeKeyHashWitness = \case
ConwayRegCommitteeHotKey coldKeyHash _ -> asWitness coldKeyHash
ConwayUnRegCommitteeHotKey coldKeyHash -> asWitness coldKeyHash
ConwayAuthCommitteeHotKey coldKeyHash _ -> asWitness coldKeyHash
ConwayResignCommitteeColdKey coldKeyHash -> asWitness coldKeyHash

data ConwayTxCert era
= ConwayTxCertDeleg !(ConwayDelegCert (EraCrypto era))
Expand Down Expand Up @@ -419,12 +419,12 @@ encodeConwayDelegCert = \case

encodeCommitteeHotKey :: Crypto c => ConwayCommitteeCert c -> Encoding
encodeCommitteeHotKey = \case
ConwayRegCommitteeHotKey cred key ->
ConwayAuthCommitteeHotKey cred key ->
encodeListLen 3
<> encodeWord8 14
<> encCBOR cred
<> encCBOR key
ConwayUnRegCommitteeHotKey cred ->
ConwayResignCommitteeColdKey cred ->
encodeListLen 2
<> encodeWord8 15
<> encCBOR cred
Expand Down
Expand Up @@ -56,8 +56,8 @@ instance Era era => Arbitrary (ConwayTxCert era) where
instance Crypto c => Arbitrary (ConwayCommitteeCert c) where
arbitrary =
oneof
[ ConwayRegCommitteeHotKey <$> arbitrary <*> arbitrary
, ConwayUnRegCommitteeHotKey <$> arbitrary
[ ConwayAuthCommitteeHotKey <$> arbitrary <*> arbitrary
, ConwayResignCommitteeColdKey <$> arbitrary
]

instance Crypto c => Arbitrary (AlonzoScript (ConwayEra c)) where
Expand Down
Expand Up @@ -138,9 +138,9 @@ ppConwayTxCert = \case

ppConwayCommitteeCert :: ConwayCommitteeCert c -> PDoc
ppConwayCommitteeCert = \case
ConwayRegCommitteeHotKey coldKey hotKey ->
ppSexp "ConwayRegCommitteeHotKey" [prettyA coldKey, prettyA hotKey]
ConwayUnRegCommitteeHotKey coldKey -> ppSexp "ConwayUnRegCommitteeHotKey" [prettyA coldKey]
ConwayAuthCommitteeHotKey coldKey hotKey ->
ppSexp "ConwayAuthCommitteeHotKey" [prettyA coldKey, prettyA hotKey]
ConwayResignCommitteeColdKey coldKey -> ppSexp "ConwayResignCommitteeColdKey" [prettyA coldKey]

ppConwayTxBody ::
forall era.
Expand Down

0 comments on commit a75752d

Please sign in to comment.