module Test.Util.SanityCheck (
    prop_sanityChecks
  , prop_securityParamConsistent
  ) where

import           Ouroboros.Consensus.Block.SupportsSanityCheck
import           Ouroboros.Consensus.Config
import           Test.Tasty.QuickCheck
import           Test.Util.Orphans.Arbitrary ()

prop_sanityChecks
  :: BlockSupportsSanityCheck blk
  => TopLevelConfig blk -> Property
prop_sanityChecks :: forall blk.
BlockSupportsSanityCheck blk =>
TopLevelConfig blk -> Property
prop_sanityChecks TopLevelConfig blk
cfg =
  TopLevelConfig blk -> [SanityCheckIssue]
forall blk.
BlockSupportsSanityCheck blk =>
TopLevelConfig blk -> [SanityCheckIssue]
sanityCheckConfig TopLevelConfig blk
cfg [SanityCheckIssue] -> [SanityCheckIssue] -> Property
forall a. (Eq a, Show a) => a -> a -> Property
=== []

prop_securityParamConsistent
  :: BlockSupportsSanityCheck blk
  => TopLevelConfig blk -> Property
prop_securityParamConsistent :: forall blk.
BlockSupportsSanityCheck blk =>
TopLevelConfig blk -> Property
prop_securityParamConsistent TopLevelConfig blk
cfg =
  TopLevelConfig blk -> Maybe SanityCheckIssue
forall blk.
BlockSupportsSanityCheck blk =>
TopLevelConfig blk -> Maybe SanityCheckIssue
checkSecurityParamConsistency TopLevelConfig blk
cfg Maybe SanityCheckIssue -> Maybe SanityCheckIssue -> Property
forall a. (Eq a, Show a) => a -> a -> Property
=== Maybe SanityCheckIssue
forall a. Maybe a
Nothing