@@ -867,7 +867,9 @@ data OperationalCertificate =
867
867
data OperationalCertificateIssueCounter =
868
868
OperationalCertificateIssueCounter
869
869
! Natural
870
- ! (VerificationKey StakePoolKey ) -- For consistency checking
870
+ -- TODO: Commenting this out as we're temporarily supporting the old op
871
+ -- cert issue counter format.
872
+ -- !(VerificationKey StakePoolKey) -- For consistency checking
871
873
deriving (Eq , Show )
872
874
deriving anyclass SerialiseAsCBOR
873
875
@@ -881,13 +883,20 @@ instance FromCBOR OperationalCertificate where
881
883
return (OperationalCertificate ocert vkey)
882
884
883
885
instance ToCBOR OperationalCertificateIssueCounter where
884
- toCBOR (OperationalCertificateIssueCounter counter vkey) =
885
- toCBOR (counter, vkey)
886
+ -- TODO: Commenting this out as we're temporarily supporting the old op
887
+ -- cert issue counter format.
888
+ -- toCBOR (OperationalCertificateIssueCounter counter vkey) =
889
+ -- toCBOR (counter, vkey)
890
+ toCBOR (OperationalCertificateIssueCounter counter) =
891
+ toCBOR counter
886
892
887
893
instance FromCBOR OperationalCertificateIssueCounter where
888
- fromCBOR = do
889
- (counter, vkey) <- fromCBOR
890
- return (OperationalCertificateIssueCounter counter vkey)
894
+ -- TODO: Commenting this out as we're temporarily supporting the old op
895
+ -- cert issue counter format.
896
+ -- fromCBOR = do
897
+ -- (counter, vkey) <- fromCBOR
898
+ -- return (OperationalCertificateIssueCounter counter vkey)
899
+ fromCBOR = OperationalCertificateIssueCounter <$> fromCBOR
891
900
892
901
instance HasTypeProxy OperationalCertificate where
893
902
data AsType OperationalCertificate = AsOperationalCertificate
@@ -929,13 +938,20 @@ issueOperationalCertificate :: VerificationKey KesKey
929
938
issueOperationalCertificate (KesVerificationKey kesVKey)
930
939
(StakePoolSigningKey poolSKey)
931
940
kesPeriod
932
- (OperationalCertificateIssueCounter counter poolVKey)
933
- | poolVKey /= poolVKey'
934
- = Left (OperationalCertKeyMismatch poolVKey poolVKey')
935
-
936
- | otherwise
937
- = Right (OperationalCertificate ocert poolVKey,
938
- OperationalCertificateIssueCounter (succ counter) poolVKey)
941
+ -- TODO: Commenting this out as we're temporarily supporting the old op
942
+ -- cert issue counter format.
943
+ -- (OperationalCertificateIssueCounter counter poolVKey)
944
+ (OperationalCertificateIssueCounter counter)
945
+ -- TODO: Commenting this out as we're temporarily supporting the old op
946
+ -- cert issue counter format.
947
+ -- \| poolVKey /= poolVKey'
948
+ -- = Left (OperationalCertKeyMismatch poolVKey poolVKey')
949
+ --
950
+ -- \| otherwise
951
+ -- = Right (OperationalCertificate ocert poolVKey,
952
+ -- OperationalCertificateIssueCounter (succ counter) poolVKey)
953
+ = Right (OperationalCertificate ocert poolVKey',
954
+ OperationalCertificateIssueCounter (succ counter))
939
955
where
940
956
poolVKey' = getVerificationKey (StakePoolSigningKey poolSKey)
941
957
0 commit comments