Skip to content

Commit 5f2ed85

Browse files
committed
Reintroduce encodedSizeExpr in Header instance
1 parent 61dee38 commit 5f2ed85

File tree

1 file changed

+6
-1
lines changed
  • ouroboros-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/Praos

1 file changed

+6
-1
lines changed

ouroboros-consensus-protocol/src/ouroboros-consensus-protocol/Ouroboros/Consensus/Protocol/Praos/Header.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import Cardano.Ledger.Binary
4242
, DecCBOR (decCBOR)
4343
, EncCBOR (..)
4444
, ToCBOR (..)
45+
, encodedSigKESSizeExpr
4546
, serialize'
4647
, unCBORGroup
4748
)
@@ -224,7 +225,11 @@ instance Crypto crypto => DecCBOR (HeaderRaw crypto) where
224225
instance Crypto crypto => DecCBOR (Annotator (HeaderRaw crypto)) where
225226
decCBOR = pure <$> decCBOR
226227

227-
instance Crypto c => EncCBOR (Header c)
228+
instance Crypto c => EncCBOR (Header c) where
229+
encodedSizeExpr size proxy =
230+
1
231+
+ encodedSizeExpr size (headerBody <$> proxy)
232+
+ encodedSigKESSizeExpr (KES.getSig . headerSig <$> proxy)
228233

229234
deriving via
230235
Mem (HeaderRaw crypto)

0 commit comments

Comments
 (0)