diff --git a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxosSpec.hs b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxosSpec.hs index 178834f1cd6..324965bb66d 100644 --- a/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxosSpec.hs +++ b/eras/alonzo/impl/testlib/Test/Cardano/Ledger/Alonzo/Imp/UtxosSpec.hs @@ -2,6 +2,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} @@ -17,9 +18,9 @@ import Cardano.Ledger.Alonzo.Core ( ) import Cardano.Ledger.Alonzo.Tx (IsValid (..)) import Cardano.Ledger.Alonzo.TxWits (Redeemers (..)) -import Cardano.Ledger.Core (EraTx (..), EraTxBody (..)) +import Cardano.Ledger.Core import Cardano.Ledger.Plutus.Data (Data (..)) -import Cardano.Ledger.Plutus.Language (Language, hashPlutusScript, withSLanguage) +import Cardano.Ledger.Plutus.Language (Language (..), hashPlutusScript, withSLanguage) import Cardano.Ledger.Shelley.LedgerState (curPParamsEpochStateL, nesEsL) import qualified Data.Map.Strict as Map import qualified Data.Set as Set @@ -29,11 +30,12 @@ import Test.Cardano.Ledger.Alonzo.ImpTest ( ImpTestState, ShelleyEraImp, getsNES, + passEpoch, produceScript, submitTxAnn_, ) import Test.Cardano.Ledger.Common -import Test.Cardano.Ledger.Plutus.Examples (redeemerSameAsDatum) +import Test.Cardano.Ledger.Plutus.Examples spec :: forall era. @@ -45,24 +47,42 @@ spec = describe "UTXOS" $ forM_ ([minBound .. eraMaxLanguage @era] :: [Language]) $ \lang -> withSLanguage lang $ \slang -> describe (show lang) $ do - let scriptHash = hashPlutusScript (redeemerSameAsDatum slang) - it "Spending script with a Datum" $ do - txIn0 <- produceScript scriptHash - submitTxAnn_ "Submit a transaction that consumes the script output" $ - mkBasicTx mkBasicTxBody - & bodyTxL . inputsTxBodyL - .~ Set.singleton txIn0 + let scripts = + [ ("redeermerSameAsDatum", redeemerSameAsDatum) + , ("purposeIsWellformedWithDatum", purposeIsWellformedWithDatum) + , ("datumIsWellformed", datumIsWellformed) + , ("inputsOutputsAreNotEmptyWithDatum", inputsOutputsAreNotEmptyWithDatum) + ] + describe "Spending scripts with a Datum" $ do + forM_ scripts $ \(name, script) -> do + it name $ do + let sHash = hashPlutusScript (script slang) + txIn0 <- produceScript sHash + submitTxAnn_ "Submit a transaction that consumes the script output" $ + mkBasicTx mkBasicTxBody + & bodyTxL . inputsTxBodyL + .~ Set.singleton txIn0 + passEpoch it "Invalid plutus script fails in phase 2" $ do + let scriptHash = hashPlutusScript (redeemerSameAsDatum slang) txIn0 <- produceScript scriptHash exUnits <- getsNES $ nesEsL . curPParamsEpochStateL . ppMaxTxExUnitsL submitTxAnn_ "Submitting consuming transaction" $ - ( mkBasicTx mkBasicTxBody - & bodyTxL . inputsTxBodyL .~ Set.singleton txIn0 - & isValidTxL .~ IsValid False - & witsTxL . rdmrsTxWitsL - .~ Redeemers - ( Map.singleton - (mkSpendingPurpose $ AsIx 0) - (Data $ P.I 32, exUnits) - ) - ) + mkBasicTx mkBasicTxBody + & bodyTxL . inputsTxBodyL .~ Set.singleton txIn0 + & isValidTxL .~ IsValid False + & witsTxL . rdmrsTxWitsL + .~ Redeemers + ( Map.singleton + (mkSpendingPurpose $ AsIx 0) + (Data $ P.I 32, exUnits) + ) + describe "Scripts pass in phase 2" $ do + let scripts' = drop 1 scripts + forM_ scripts' $ \(name, script) -> do + it name $ do + let sHash = hashPlutusScript (script slang) + txIn0 <- produceScript sHash + submitTxAnn_ "Submitting consuming transaction" $ + mkBasicTx mkBasicTxBody + & bodyTxL . inputsTxBodyL .~ Set.singleton txIn0 diff --git a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Plutus/Examples.hs b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Plutus/Examples.hs index 935a40dd580..91f2c9959fd 100644 --- a/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Plutus/Examples.hs +++ b/libs/cardano-ledger-core/testlib/Test/Cardano/Ledger/Plutus/Examples.hs @@ -2259,7 +2259,7 @@ purposeIsWellformedWithDatum = , "573466e1d20040021122200113006491035054310035573c0046aae74004dd5000919319ab9c00100212001232" , "30010012300223300200200101" ] - -- ScriptHash "16b052071c0a45c44387d3bf29d9183b145af613508ffea779e933d9" + -- ScriptHash "98a8d7d5251391ed12505af44dca86bdc7dcc8581ebc439463d93014" -- Preprocessed PlutusV3 Script: -- @@@ -- purposeIsWellformedWithDatum_0 :: PlutusTx.Builtins.Internal.BuiltinData -> @@ -2268,11 +2268,11 @@ purposeIsWellformedWithDatum = -- {PlutusLedgerApi.V3.Contexts.ScriptContext txInfo_2 -- _redeemer_3 -- (PlutusLedgerApi.V3.Contexts.SpendingScript txOutRef_4 - -- (GHC.Maybe.Just _)) -> Data.Foldable.null GHC.Base.$ (PlutusTx.List.filter ((txOutRef_4 PlutusTx.Eq.==) GHC.Base.. PlutusLedgerApi.V3.Contexts.txInInfoOutRef) GHC.Base.$ PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_2); + -- (GHC.Maybe.Just _)) -> GHC.Classes.not GHC.Base.$ (Data.Foldable.null GHC.Base.$ (PlutusTx.List.filter ((txOutRef_4 PlutusTx.Eq.==) GHC.Base.. PlutusLedgerApi.V3.Contexts.txInInfoOutRef) GHC.Base.$ PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_2)); -- _ -> GHC.Types.False}) -- @@@ SPlutusV3 -> - [ "590b500101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" + [ "590b560101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" , "b9a3370e9000001099191919191919191919191919191919199999999999919991991991111111111111114004" , "04201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302123232325333" , "573466e1d20000021800980e9aba100198029aba1357440021302d4901035054310035573c0046aae74004dd50" @@ -2323,20 +2323,20 @@ purposeIsWellformedWithDatum = , "10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019" , "bad357426ae8800426028921035054310035573c0046aae74004dd50009aba20011300f491035054310035573c" , "0046aae74004dd5000c88a400644260229210350543500909808248103505435009109808a4903505435009098" - , "082481035054350091914ac800c8564c00e401e44444444444444440208c002443002460048a4d130124910350" - , "5435001808912c800c60012213259329007914801c894ccd5cd19b8f0040021333573466e1c00c006001002180" - , "1120072200246006007001440046008002909808248103505435000c02c8894ccd5cd19b87480000044c035241" - , "035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00666e10008004" - , "660080040026014444a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9" - , "f00128001400cc010d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae" - , "68cdc3a40040043003375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a33" - , "70e90010010c00854ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd" - , "50009119118011bab00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c" - , "6ae8400a00040024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a4810350543100" - , "35573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae8" - , "40042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a337" - , "0e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319" - , "ab9c0018001191800800918011198010010009" + , "082481035054350091914ac800c856564c00e401e44444444444444440208c0024430024600518002300245268" + , "9809248103505435001808912c800c60012213259329007914801c894ccd5cd19b8f0040021333573466e1c00c" + , "0060010021801120072200246006007001440046008002909808248103505435000c02c8894ccd5cd19b874800" + , "00044c035241035054330015333573466e20005200013300333702900000119b81480000044ca00266e1000c00" + , "666e10008004660080040026014444a666ae68cdc3a4000002200426600600266e180080048c88c008dd600098" + , "05111999aab9f00128001400cc010d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae" + , "840042a666ae68cdc3a40040043003375c6ae8400426016921035054310035573c0046aae74004dd5000911919" + , "192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae8400426016921035054310035573c00" + , "46aae74004dd50009119118011bab00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a" + , "60086ae8800c6ae8400a00040024646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a4" + , "81035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b8748008008" + , "6002600a6ae840042a666ae68cdc3a40080043004130074901035054310035573c0046aae74004dd5000919191" + , "92999ab9a3370e90000010c004dd71aba10019bad357426ae880042600a921035054310035573c0046aae74004" + , "dd5000919319ab9c0018001191800800918011198010010009" ] -- | Script that succeeds when datum is expected and datum is validated against txInfo @@ -2456,7 +2456,7 @@ datumIsWellformed = , "ae78004c010d5d10019aba10020051200112200212200130032253350011004221335005350022200130040011" , "22002122122330010040032323001001230022330020020011" ] - -- ScriptHash "883bc139d6591f366cb12f95fba30920fc4597affbbd20eed74e142d" + -- ScriptHash "68e3bd8e774d5b42f50af9cb683378a1def88cd3b354a51fd217e8cb" -- Preprocessed PlutusV3 Script: -- @@@ -- datumIsWellformed_0 :: PlutusTx.Builtins.Internal.BuiltinData -> @@ -2465,11 +2465,11 @@ datumIsWellformed = -- {PlutusLedgerApi.V3.Contexts.ScriptContext txInfo_2 -- _redeemer_3 -- (PlutusLedgerApi.V3.Contexts.SpendingScript _txOutRef_4 - -- (GHC.Maybe.Just datum_5)) -> Data.Foldable.null GHC.Base.$ (PlutusTx.List.filter (datum_5 PlutusTx.Eq.==) GHC.Base.$ (PlutusTx.AssocMap.elems GHC.Base.$ PlutusLedgerApi.V3.Contexts.txInfoData txInfo_2)); + -- (GHC.Maybe.Just datum_5)) -> GHC.Classes.not GHC.Base.$ (Data.Foldable.null GHC.Base.$ (PlutusTx.List.filter (datum_5 PlutusTx.Eq.==) GHC.Base.$ (PlutusTx.AssocMap.elems GHC.Base.$ PlutusLedgerApi.V3.Contexts.txInfoData txInfo_2))); -- _ -> GHC.Types.False}) -- @@@ SPlutusV3 -> - [ "590b4b010100323232323232323232323232322593232325333573466e1d200000213232323232800991919299" + [ "590b51010100323232323232323232323232322593232325333573466e1d200000213232323232800991919299" , "9ab9a3370e90000010991919191919191919191919191919191999999999999199919919911111111111111140" , "0404201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba10133025232323253" , "33573466e1d20000021800980e9aba100198029aba1357440021302c4901035054310035573c0046aae74004dd" @@ -2479,7 +2479,7 @@ datumIsWellformed = , "5744002130304901035054310035573c0046aae74004dd51aba100398039aba10029919192999ab9a3370e9000" , "0010c00054ccd5cd19b8748008008600a6eb8d5d0800854ccd5cd19b874801000860066ae84004260609210350" , "54310035573c0046aae74004dd51aba1001998163ae357426ae880046ae88004d5d100089815a4810350543100" - , "35573c0046aae74004dd50009bad3574201e60026ae84038c004c005d69981180a9aba100c33302702475a6ae8" + , "35573c0046aae74004dd50009bad3574201e60026ae84038c008c009d69981180a9aba100c33302702475a6ae8" , "402cc8c8c94ccd5cd19b87480000086002646464a666ae68cdc3a400000430013302775a6ae84006604c6ae84d" , "5d100084c0b12401035054310035573c0046aae74004dd51aba10019919192999ab9a3370e90000010c004cc09" , "dd69aba100198131aba1357440021302c491035054310035573c0046aae74004dd51aba1357440021302949103" @@ -2487,9 +2487,9 @@ datumIsWellformed = , "6eb8d5d0800854ccd5cd19b8748008008601260366ae840042a666ae68cdc3a400800430073028357420021533" , "3573466e1d200600218009bad357420033019357426ae880042a666ae68cdc3a4010004300b301a35742002153" , "33573466e1d200a00218029bad357420033018357426ae88004260549201035054310035573c0046aae74004dd" - , "500080f9aba10083300101f3574200e6eb8d5d080319981380b1981381111919192999ab9a3370e90000010c00" + , "500080f9aba10083300201f3574200e6eb8d5d080319981380b1981381111919192999ab9a3370e90000010c00" , "854ccd5cd19b874800800860082a666ae68cdc3a400800430001302a4901035054310035573c0046aae74004dd" - , "50009aba1005330230143574200860046ae8400cc008d5d09aba2003302675c6046eb4d5d10009aba200135744" + , "50009aba1005330230143574200860026ae8400cc004d5d09aba2003302475a604aeb8d5d10009aba200135744" , "0026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba200113" , "016491035054310035573c0046aae74004dd51aba10069aba10059919192999ab9a3370e90000010c00cdd71ab" , "a10010a999ab9a3370e90010010c024c01cd5d0800ccc05403cd5d09aba20010a999ab9a3370e90020010c01cc" @@ -2520,20 +2520,20 @@ datumIsWellformed = , "ba10010980a249035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba100" , "19bad357426ae8800426026921035054310035573c0046aae74004dd50009aba20011300e49103505431003557" , "3c0046aae74004dd5000c88a400644260209210350543500909807a48103505435009109808249035054350090" - , "9807a4810350543500914ac800c8c8564c004c052401e444444444444444400c8c002443002180a112c800c600" - , "1221325333573466ebc01800c600600700108009802000a300245268980824810350543500484c03d241035054" - , "35000c0308894ccd5cd19b87480000044c031241035054330015333573466e2000520001330033370290000011" - , "9b81480000044ca00266e1000c00666e10008004660080040026016444a666ae68cdc3a4000002200426600600" - , "266e1800800480048c8c8c94ccd5cd19b874800000860042a666ae68cdc3a400400430001300a4910350543100" - , "35573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae8" - , "40042a666ae68cdc3a400800430041300a4901035054310035573c0046aae74004dd500091919192999ab9a337" - , "0e90000010c004dd71aba10019bad357426ae8800426010921035054310035573c0046aae74004dd5000919118" - , "011bac00130072233335573e0025000280198021aba100298019aba200240008c8c8c94ccd5cd19b8748000008" - , "60026eb8d5d0800854ccd5cd19b874800800860066eb8d5d080084c0192401035054310035573c0046aae74004" - , "dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae840042600c921035054" - , "310035573c0046aae74004dd5000919319ab9c0018001119118011bab00130042233335573e0025000232801c0" - , "04c018d55ce800cc014d55cf000a60086ae8800c6ae8400a000600244b2003180048860072005220014c010004" - , "2323001001230022330020020011" + , "9807a4810350543500914ac800c8c856564c004c052401e444444444444444400c8c0024430024600518000c05" + , "089640063000910992999ab9a3375e00c006300300380084004c0100051801229344c04124010350543500484c" + , "03d24103505435000c0308894ccd5cd19b87480000044c031241035054330015333573466e2000520001330033" + , "3702900000119b81480000044ca00266e1000c00666e10008004660080040026016444a666ae68cdc3a4000002" + , "200426600600266e1800800480048c8c8c94ccd5cd19b874800000860042a666ae68cdc3a400400430001300a4" + , "91035054310035573c0046aae74004dd5000911919192999ab9a3370e90000010c00854ccd5cd19b8748008008" + , "6002600a6ae840042a666ae68cdc3a400800430041300a4901035054310035573c0046aae74004dd5000919191" + , "92999ab9a3370e90000010c004dd71aba10019bad357426ae8800426010921035054310035573c0046aae74004" + , "dd5000919118011bac00130072233335573e0025000280198021aba100298019aba200240008c8c8c94ccd5cd1" + , "9b874800000860026eb8d5d0800854ccd5cd19b874800800860066eb8d5d080084c0192401035054310035573c" + , "0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87480000086002600a6ae8400426" + , "00c921035054310035573c0046aae74004dd5000919319ab9c0018001119118011bab00130042233335573e002" + , "5000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a000600244b20031800488600720052" + , "20014c0100042323001001230022330020020011" ] -- | Script that succeeds when inputs and outputs are not empty validated against txInfo @@ -2645,7 +2645,7 @@ inputsOutputsAreNotEmptyNoDatum = , "00115333573466e1d20040021122200113006491035054310035573c0046aae74004dd5000919319ab9c001002" , "1200123230010012300223300200200101" ] - -- ScriptHash "c69c97698802d9ffe444c17bb6a146d508a53ff8a135ccd1e7219912" + -- ScriptHash "80573645f5a826ed5f7b2f5a336a71d9add9ec531960b3a993e12281" -- Preprocessed PlutusV3 Script: -- @@@ -- inputsOutputsAreNotEmptyNoDatum_0 :: PlutusTx.Builtins.Internal.BuiltinData -> @@ -2657,10 +2657,10 @@ inputsOutputsAreNotEmptyNoDatum = -- (GHC.Maybe.Just _)) -> GHC.Types.False; -- PlutusLedgerApi.V3.Contexts.ScriptContext txInfo_5 -- _redeemer_6 - -- _scriptPurpose_7 -> Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_5) GHC.Classes.|| Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoOutputs txInfo_5)}) + -- _scriptPurpose_7 -> GHC.Classes.not GHC.Base.$ (Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_5) GHC.Classes.|| Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoOutputs txInfo_5))}) -- @@@ SPlutusV3 -> - [ "590b150101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" + [ "590b1b0101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" , "b9a3370e9000001099191919191919191919191919191919199999999999919991991991111111111111114004" , "04201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302123232325333" , "573466e1d20000021800980e9aba100198029aba1357440021302d4901035054310035573c0046aae74004dd50" @@ -2711,19 +2711,19 @@ inputsOutputsAreNotEmptyNoDatum = , "10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019" , "bad357426ae8800426028921035054310035573c0046aae74004dd50009aba20011300f491035054310035573c" , "0046aae74004dd5000c88a4ca400a4460069348c00926911801a4d2300249a44b20032180144c00d2648c00926" - , "11919192c80146001100118014803488888888888888880386003200b222222222222222201012c800c6001221" - , "801229344c03d24103505435000c02c8894ccd5cd19b87480000044c035241035054330015333573466e200052" - , "00013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026014444a666ae68cd" - , "c3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc010d5d08014c00" - , "cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a40040043003375c6ae840" - , "0426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87" - , "480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011bab00130082233" - , "335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024646464a666ae" - , "68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae74004dd50009119" - , "19192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a4008004300" - , "4130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019ba" - , "d357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c001800119180080091801119" - , "8010010009" + , "12c9919192c80146001100118014803488888888888888880386003200b222222222222222201012c800c60012" + , "21801230028c001149a2601e920103505435000c02c8894ccd5cd19b87480000044c0352410350543300153335" + , "73466e20005200013300333702900000119b81480000044ca00266e1000c00666e100080046600800400260144" + , "44a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc01" + , "0d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a400400430" + , "03375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c0085" + , "4ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011ba" + , "b00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024" + , "646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae740" + , "04dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc" + , "3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd" + , "71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c001800119180" + , "0800918011198010010009" ] -- | Script that succeeds when inputs and outputs are not empty validated against txInfo @@ -2839,7 +2839,7 @@ inputsOutputsAreNotEmptyWithDatum = , "00115333573466e1d20040021122200113006491035054310035573c0046aae74004dd5000919319ab9c001002" , "1200123230010012300223300200200101" ] - -- ScriptHash "2be618e3eb9f05ee55b3d855344261c1723a91940c78805b64311b1e" + -- ScriptHash "4278cbc1b3b8aad33bcb2dde2ac2d71e921e026470f73991c7235bbe" -- Preprocessed PlutusV3 Script: -- @@@ -- inputsOutputsAreNotEmptyWithDatum_0 :: PlutusTx.Builtins.Internal.BuiltinData -> @@ -2851,10 +2851,10 @@ inputsOutputsAreNotEmptyWithDatum = -- (GHC.Maybe.Nothing)) -> GHC.Types.False; -- PlutusLedgerApi.V3.Contexts.ScriptContext txInfo_5 -- _redeemer_6 - -- _scriptPurpose_7 -> Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_5) GHC.Classes.|| Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoOutputs txInfo_5)}) + -- _scriptPurpose_7 -> GHC.Classes.not GHC.Base.$ (Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoInputs txInfo_5) GHC.Classes.|| Data.Foldable.null (PlutusLedgerApi.V3.Contexts.txInfoOutputs txInfo_5))}) -- @@@ SPlutusV3 -> - [ "590b150101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" + [ "590b1b0101003232323232323232323232322593232325333573466e1d2000002132323232328009919192999a" , "b9a3370e9000001099191919191919191919191919191919199999999999919991991991111111111111114004" , "04201f00e806c03201700a804c02200f006802c0120070028008c004d5d080a18009aba1013302123232325333" , "573466e1d20000021800980e9aba100198029aba1357440021302d4901035054310035573c0046aae74004dd50" @@ -2905,17 +2905,17 @@ inputsOutputsAreNotEmptyWithDatum = , "10010980aa49035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019" , "bad357426ae8800426028921035054310035573c0046aae74004dd50009aba20011300f491035054310035573c" , "0046aae74004dd5000c88a4ca400a4460069348c00926911801a4d2300249a44b200321300449a300248c00926" - , "11919192c80146001100118014803488888888888888880386003200b222222222222222201012c800c6001221" - , "801229344c03d24103505435000c02c8894ccd5cd19b87480000044c035241035054330015333573466e200052" - , "00013300333702900000119b81480000044ca00266e1000c00666e10008004660080040026014444a666ae68cd" - , "c3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc010d5d08014c00" - , "cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a40040043003375c6ae840" - , "0426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c00854ccd5cd19b87" - , "480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011bab00130082233" - , "335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024646464a666ae" - , "68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae74004dd50009119" - , "19192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc3a4008004300" - , "4130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd71aba10019ba" - , "d357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c001800119180080091801119" - , "8010010009" + , "12c9919192c80146001100118014803488888888888888880386003200b222222222222222201012c800c60012" + , "21801230028c001149a2601e920103505435000c02c8894ccd5cd19b87480000044c0352410350543300153335" + , "73466e20005200013300333702900000119b81480000044ca00266e1000c00666e100080046600800400260144" + , "44a666ae68cdc3a4000002200426600600266e180080048c88c008dd60009805111999aab9f00128001400cc01" + , "0d5d08014c00cd5d100120004646464a666ae68cdc3a40000043001375c6ae840042a666ae68cdc3a400400430" + , "03375c6ae8400426016921035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010c0085" + , "4ccd5cd19b87480000086002600a6ae8400426016921035054310035573c0046aae74004dd50009119118011ba" + , "b00130082233335573e0025000232801c004c018d55ce800cc014d55cf000a60086ae8800c6ae8400a00040024" + , "646464a666ae68cdc3a4000004300215333573466e1d2002002180009803a481035054310035573c0046aae740" + , "04dd5000911919192999ab9a3370e90000010c00854ccd5cd19b87480080086002600a6ae840042a666ae68cdc" + , "3a40080043004130074901035054310035573c0046aae74004dd500091919192999ab9a3370e90000010c004dd" + , "71aba10019bad357426ae880042600a921035054310035573c0046aae74004dd5000919319ab9c001800119180" + , "0800918011198010010009" ] diff --git a/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs b/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs index aed30e6f645..4abe18b7960 100644 --- a/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs +++ b/libs/plutus-preprocessor/src/Cardano/Ledger/Plutus/Preprocessor/Source/V3.hs @@ -156,7 +156,7 @@ purposeIsWellformedWithDatumQ = P.check $ case unsafeFromBuiltinData arg of PV3.ScriptContext txInfo _redeemer (PV3.SpendingScript txOutRef (Just _)) -> - null $ P.filter ((txOutRef P.==) . PV3.txInInfoOutRef) $ PV3.txInfoInputs txInfo + not $ null $ P.filter ((txOutRef P.==) . PV3.txInInfoOutRef) $ PV3.txInfoInputs txInfo _ -> False |] @@ -168,7 +168,7 @@ datumIsWellformedQ = P.check $ case unsafeFromBuiltinData arg of PV3.ScriptContext txInfo _redeemer (PV3.SpendingScript _txOutRef (Just datum)) -> - null $ P.filter (datum P.==) $ PAM.elems $ PV3.txInfoData txInfo + not $ null $ P.filter (datum P.==) $ PAM.elems $ PV3.txInfoData txInfo _ -> False |] @@ -182,7 +182,7 @@ inputsOutputsAreNotEmptyNoDatumQ = -- When there is a datum supplied, we need to fail. PV3.ScriptContext _txInfo _redeemer (PV3.SpendingScript _txOutRef (Just _)) -> False PV3.ScriptContext txInfo _redeemer _scriptPurpose -> - null (PV3.txInfoInputs txInfo) || null (PV3.txInfoOutputs txInfo) + not $ null (PV3.txInfoInputs txInfo) || null (PV3.txInfoOutputs txInfo) |] inputsOutputsAreNotEmptyWithDatumQ :: Q [Dec] @@ -194,5 +194,5 @@ inputsOutputsAreNotEmptyWithDatumQ = case unsafeFromBuiltinData arg of PV3.ScriptContext _txInfo _redeemer (PV3.SpendingScript _txOutRef Nothing) -> False PV3.ScriptContext txInfo _redeemer _scriptPurpose -> - null (PV3.txInfoInputs txInfo) || null (PV3.txInfoOutputs txInfo) + not $ null (PV3.txInfoInputs txInfo) || null (PV3.txInfoOutputs txInfo) |]