Add after review fixes.

This commit is contained in:
adamczykm 2022-11-11 16:09:42 +01:00 committed by Hongrui Fang
parent 60432ab5ae
commit e294db2847
No known key found for this signature in database
GPG key ID: F10AB2CCE24113DD

View file

@ -84,8 +84,8 @@ import Test.QuickCheck (
forAll,
listOf1,
)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.QuickCheck (testProperty)
import Test.Tasty (TestTree, adjustOption, testGroup)
import Test.Tasty.QuickCheck (QuickCheckTests, testProperty)
data GovernorDatumCases
= ExecuteLE0
@ -205,8 +205,8 @@ governorMintingPolicyTests =
and checking if it runs as expected by a test.
-}
governorPolicyValid :: ScriptContext -> Bool -> Property
governorPolicyValid ctx shouldSuceed =
let mp = mkPolicyScript ctx in if shouldSuceed then shouldRun mp else shouldCrash mp
governorPolicyValid ctx shouldSucceed =
let mp = mkPolicyScript ctx in if shouldSucceed then shouldRun mp else shouldCrash mp
{-# INLINEABLE mkPolicyScript #-}
mkPolicyScript :: ScriptContext -> Script
@ -220,9 +220,7 @@ mkPolicyScript ctx = mustCompile (go # pconstant ctx)
# pforgetData (pconstantData ())
# sc
{- | Prepares a minting policy test for given policy error case.
NOTE
-}
-- | Prepares a minting policy test for given policy error case.
mkGovMintingCasePropertyTest ::
String ->
GovernorPolicyCases ->
@ -288,9 +286,12 @@ mkGovMintingCasePropertyTest name case' positiveCaseName negativeCaseName =
props :: [TestTree]
props =
[ testProperty "governorDatumValid" governorDatumValidProperty
[ adjustOption go . testProperty "governorDatumValid" $ governorDatumValidProperty
, testGroup "governorPolicy" governorMintingPolicyTests
]
where
go :: QuickCheckTests -> QuickCheckTests
go = min 2000
loudEval ::
forall (p :: S -> Type).