{-# OPTIONS_GHC -Wno-orphans #-}
module Hydra.Cardano.Api.ChainPoint where
import Hydra.Cardano.Api.Prelude
getChainPoint :: BlockHeader -> ChainPoint
getChainPoint :: BlockHeader -> ChainPoint
getChainPoint BlockHeader
header =
SlotNo -> Hash BlockHeader -> ChainPoint
ChainPoint SlotNo
slotNo Hash BlockHeader
headerHash
where
(BlockHeader SlotNo
slotNo Hash BlockHeader
headerHash BlockNo
_) = BlockHeader
header
instance Arbitrary ChainPoint where
arbitrary :: Gen ChainPoint
arbitrary =
ChainPoint -> Gen ChainPoint
forall a. a -> Gen a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ChainPoint
ChainPointAtGenesis