@@ -57,6 +57,9 @@ showPV (MajorProtocolVersion pv) =
5757errorScript :: SerialisedScript
5858errorScript = serialiseUPLC $ UPLC. Program () PLC. plcVersion100 $ UPLC. Error ()
5959
60+ v100script :: UPLC. Program UPLC. DeBruijn UPLC. DefaultUni UPLC. DefaultFun ()
61+ v100script = UPLC. Program () PLC. plcVersion100 $ UPLC. Constant () (PLC. Some (PLC. ValueOf PLC. DefaultUniUnit () ))
62+
6063v110script :: UPLC. Program UPLC. DeBruijn UPLC. DefaultUni UPLC. DefaultFun ()
6164v110script = UPLC. Program () PLC. plcVersion110 $ UPLC. Constr () 0 mempty
6265
@@ -119,23 +122,28 @@ testLedgerLanguages = testGroup "ledger languages"
119122testLanguageVersions :: TestTree
120123testLanguageVersions =
121124 testGroup " Plutus Core language versions" $
122- let expectGood prog ll pv =
125+ let expectGood plcv prog ll pv =
123126 testCase (" Ok in " ++ showPV pv) $
124- assertBool (" v110 " ++ " not allowed in " ++ show ll ++ " @" ++ showPV pv) $
127+ assertBool (plcv ++ " not allowed in " ++ show ll ++ " @" ++ showPV pv) $
125128 isRight $ mkTestTerm ll pv prog
126- expectBad prog ll pv =
129+ expectBad plcv prog ll pv =
127130 testCase (" Not in " ++ showPV pv) $
128- assertBool (" v110 " ++ " should not be allowed in " ++ show ll ++ " @" ++ showPV pv) $
131+ assertBool (plcv ++ " should not be allowed in " ++ show ll ++ " @" ++ showPV pv) $
129132 isLeft $ mkTestTerm ll pv prog
130- testOkFrom ll firstGood prog =
133+ testOkFrom plcv ll firstGood prog =
131134 let expectedGood = [ firstGood .. newestPV ]
132135 in testGroup (show ll) $
133- fmap (expectBad prog ll) (allPVs \\ expectedGood) ++
134- fmap (expectGood prog ll) expectedGood
135- in [ testGroup " v1.1.0 availability"
136- [ testOkFrom PlutusV1 newestPV v110script
137- , testOkFrom PlutusV2 newestPV v110script
138- , testOkFrom PlutusV3 changPV v110script
136+ fmap (expectBad plcv prog ll) (allPVs \\ expectedGood) ++
137+ fmap (expectGood plcv prog ll) expectedGood
138+ in [ testGroup " v1.0.0 availability"
139+ [ testOkFrom " v100" PlutusV1 alonzoPV v100script
140+ , testOkFrom " v100" PlutusV2 vasilPV v100script
141+ , testOkFrom " v100" PlutusV3 changPV v100script
142+ ]
143+ , testGroup " v1.1.0 availability"
144+ [ testOkFrom " v110" PlutusV1 newestPV v110script
145+ , testOkFrom " v110" PlutusV2 newestPV v110script
146+ , testOkFrom " v110" PlutusV3 changPV v110script
139147 ]
140148 -- Check that case and constr are not allowed in 1.1.0 in any LL/PV combination
141149 , testCase " case is not available in v1.0.0 ever" $
0 commit comments