{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}

module Cardano.Ledger.Shelley.SoftForks
  ( validMetadata,
    restrictPoolMetadataHash,
  )
where

import Cardano.Ledger.BaseTypes (ProtVer (..))
import GHC.Records

validMetadata ::
  (HasField "_protocolVersion" pp ProtVer) =>
  pp ->
  Bool
validMetadata :: pp -> Bool
validMetadata pp
pp = pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp ProtVer -> ProtVer -> Bool
forall a. Ord a => a -> a -> Bool
> Natural -> Natural -> ProtVer
ProtVer Natural
2 Natural
0

restrictPoolMetadataHash ::
  (HasField "_protocolVersion" pp ProtVer) =>
  pp ->
  Bool
restrictPoolMetadataHash :: pp -> Bool
restrictPoolMetadataHash pp
pp = pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp ProtVer -> ProtVer -> Bool
forall a. Ord a => a -> a -> Bool
> Natural -> Natural -> ProtVer
ProtVer Natural
4 Natural
0