@@ -41,7 +41,6 @@ import Cardano.Ledger.TxIn (TxIn (..))
41
41
import Cardano.Ledger.Val
42
42
import qualified Data.ByteString.Short as SBS (length )
43
43
import Data.Functor ((<&>) )
44
- import qualified Data.List.NonEmpty as NE
45
44
import qualified Data.Map.Strict as Map
46
45
import qualified Data.Sequence.Strict as SSeq
47
46
import qualified Data.Set as Set
@@ -82,35 +81,31 @@ spec =
82
81
describe " disjoint inputs and reference inputs" $ do
83
82
let
84
83
scriptHash lang = hashPlutusScript $ inputsOverlapsWithRefInputs lang
85
- tx :: TxIn -> Tx era
86
- tx txIn =
84
+ mkTestTx :: TxIn -> Tx era
85
+ mkTestTx txIn =
87
86
mkBasicTx mkBasicTxBody
88
87
& bodyTxL . inputsTxBodyL .~ Set. singleton txIn
89
88
& bodyTxL . referenceInputsTxBodyL .~ Set. singleton txIn
90
89
91
- it " Can run scripts that expect inputs and refInputs to overlap (PV 9)" . whenMajorVersion @ 9 $ do
90
+ it " Cannot run scripts that expect inputs and refInputs to overlap (PV 9)" $ whenMajorVersion @ 9 $ do
92
91
txIn <- produceScript $ scriptHash SPlutusV3
93
- submitTx_ @ era $ tx txIn
94
- it " Same script cannot appear in regular and reference inputs in PlutusV3 (PV 10)"
95
- . whenMajorVersion @ 10
96
- $ do
97
- txIn <- produceScript $ scriptHash SPlutusV3
98
- submitFailingTx @ era
99
- (tx txIn)
100
- [ injectFailure $
101
- BabbageNonDisjointRefInputs
102
- (txIn NE. :| [] )
103
- ]
104
- it " Same script cannot appear in regular and reference inputs in PlutusV3 (PV 11)"
105
- . whenMajorVersionAtLeast @ 11
106
- $ do
107
- txIn <- produceScript $ scriptHash SPlutusV3
108
- submitFailingTx @ era
109
- (tx txIn)
110
- [ injectFailure $
111
- CollectErrors
112
- [BadTranslation . inject $ ReferenceInputsNotDisjointFromInputs @ era (txIn NE. :| [] )]
113
- ]
92
+ submitFailingTx @ era
93
+ (mkTestTx txIn)
94
+ [ injectFailure $ BabbageNonDisjointRefInputs [txIn]
95
+ ]
96
+ it " Same script cannot appear in regular and reference inputs in PlutusV3 (PV 10)" $ whenMajorVersion @ 10 $ do
97
+ txIn <- produceScript $ scriptHash SPlutusV3
98
+ submitFailingTx @ era
99
+ (mkTestTx txIn)
100
+ [ injectFailure $ BabbageNonDisjointRefInputs [txIn]
101
+ ]
102
+ it " Same script cannot appear in regular and reference inputs in PlutusV3 (PV 11)" $ whenMajorVersionAtLeast @ 11 $ do
103
+ txIn <- produceScript $ scriptHash SPlutusV3
104
+ submitFailingTx @ era
105
+ (mkTestTx txIn)
106
+ [ injectFailure $
107
+ CollectErrors [BadTranslation . inject $ ReferenceInputsNotDisjointFromInputs @ era [txIn]]
108
+ ]
114
109
where
115
110
checkMinFee :: HasCallStack => NativeScript era -> [Script era ] -> ImpTestM era ()
116
111
checkMinFee scriptToSpend refScripts = do
0 commit comments