Skip to content

Commit

Permalink
Use ToCBOR and FromCBOR instead of Serialise
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Sep 24, 2021
1 parent cfd714f commit 6f65f92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ouroboros-network/src/Ouroboros/Network/Block.hs
Expand Up @@ -91,7 +91,7 @@ import Data.Typeable (Typeable)
import GHC.Generics (Generic)
import NoThunks.Class (NoThunks)

import Cardano.Binary (Case (..), Size, szCases, szGreedy)
import Cardano.Binary (Case (..), Size, szCases, szGreedy, ToCBOR (..), FromCBOR (..))
import Cardano.Slotting.Block
import Cardano.Slotting.Slot (SlotNo (..))

Expand Down Expand Up @@ -420,6 +420,12 @@ instance Serialise (HeaderHash block) => Serialise (Point block) where
encode = encodePoint encode
decode = decodePoint decode

instance (Typeable block, Serialise (HeaderHash block)) => FromCBOR (Point block) where
fromCBOR = decodePoint decode

instance (Typeable block, Serialise (HeaderHash block)) => ToCBOR (Point block) where
toCBOR = encodePoint encode

encodeChainHash :: (HeaderHash block -> Encoding)
-> (ChainHash block -> Encoding)
encodeChainHash encodeHash chainHash =
Expand Down

0 comments on commit 6f65f92

Please sign in to comment.