{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeApplications #-}
module Cardano.Ledger.Shelley.HardForks
( aggregatedRewards,
allowMIRTransfer,
validatePoolRewardAccountNetID,
allowScriptStakeCredsToEarnRewards,
translateTimeForPlutusScripts,
missingScriptsSymmetricDifference,
forgoRewardPrefilter,
allowOutsideForecastTTL,
)
where
import Cardano.Ledger.BaseTypes (ProtVer (..))
import GHC.Records
aggregatedRewards ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
aggregatedRewards :: pp -> Bool
aggregatedRewards pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
2
allowMIRTransfer ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
allowMIRTransfer :: pp -> Bool
allowMIRTransfer pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
4
validatePoolRewardAccountNetID ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
validatePoolRewardAccountNetID :: pp -> Bool
validatePoolRewardAccountNetID pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
4
allowScriptStakeCredsToEarnRewards ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
allowScriptStakeCredsToEarnRewards :: pp -> Bool
allowScriptStakeCredsToEarnRewards pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
4
translateTimeForPlutusScripts ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
translateTimeForPlutusScripts :: pp -> Bool
translateTimeForPlutusScripts pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
5
missingScriptsSymmetricDifference ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
missingScriptsSymmetricDifference :: pp -> Bool
missingScriptsSymmetricDifference pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
6
forgoRewardPrefilter ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
forgoRewardPrefilter :: pp -> Bool
forgoRewardPrefilter pp
pp = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp) Natural -> Natural -> Bool
forall a. Ord a => a -> a -> Bool
> Natural
6
allowOutsideForecastTTL ::
(HasField "_protocolVersion" pp ProtVer) =>
pp ->
Bool
allowOutsideForecastTTL :: pp -> Bool
allowOutsideForecastTTL pp
pp =
let mv :: Natural
mv = ProtVer -> Natural
pvMajor (pp -> ProtVer
forall k (x :: k) r a. HasField x r a => r -> a
getField @"_protocolVersion" pp
pp)
in Natural
mv Natural -> Natural -> Bool
forall a. Eq a => a -> a -> Bool
== Natural
5 Bool -> Bool -> Bool
|| Natural
mv Natural -> Natural -> Bool
forall a. Eq a => a -> a -> Bool
== Natural
6