@@ -49,7 +49,7 @@ goodCases = [ Case 0 0 10000 9000 9000 10000
49
49
wrongSigner :: [Case ]
50
50
wrongSigner = [ Case 0 1 10000 9000 9000 10000
51
51
, Case 0 2 10000 9000 9000 10000
52
- , Case 1 2 10000 9000 9000 10000
52
+ , Case 1 0 10000 9000 9000 10000
53
53
, Case 1 2 10000 9000 9000 10000
54
54
, Case 2 0 10000 9000 9000 10000
55
55
, Case 2 1 10000 9000 9000 10000
@@ -113,8 +113,8 @@ mintingTx tp val pkh =
113
113
]
114
114
115
115
116
- script2 :: TxOutRef -> TokenName -> HomeworkScript
117
- script2 txOutRef tn = TypedPolicy $ toV2 $ H2. nftPolicy txOutRef tn
116
+ script2 :: TxOutRef -> HomeworkScript
117
+ script2 txOutRef = TypedPolicy $ toV2 $ H2. nftPolicy txOutRef
118
118
119
119
homework2 :: MockConfig -> TestTree
120
120
homework2 cfg = do
@@ -149,7 +149,7 @@ changeSigner sig = do
149
149
150
150
utxos <- utxoAt beneficiary
151
151
let [(ref, out)] = utxos
152
- typedPolicy = script2 ref " "
152
+ typedPolicy = script2 ref
153
153
mintingValue = singleton (scriptCurrencySymbol typedPolicy) " " 1
154
154
valueInOutput = txOutValue out
155
155
checkBalance (owns beneficiary mintingValue) $ do
@@ -162,7 +162,7 @@ changeAmount amt = do
162
162
163
163
utxos <- utxoAt beneficiary
164
164
let [(ref, out)] = utxos
165
- typedPolicy = script2 ref " "
165
+ typedPolicy = script2 ref
166
166
mintingValue = singleton (scriptCurrencySymbol typedPolicy) " " amt
167
167
valueInOutput = txOutValue out
168
168
checkBalance (owns beneficiary mintingValue) $ do
@@ -175,7 +175,7 @@ changeTokenName tn = do
175
175
176
176
utxos <- utxoAt beneficiary
177
177
let [(ref, out)] = utxos
178
- typedPolicy = script2 ref " "
178
+ typedPolicy = script2 ref
179
179
mintingValue = singleton (scriptCurrencySymbol typedPolicy) tn 1
180
180
valueInOutput = txOutValue out
181
181
checkBalance (owns beneficiary mintingValue) $ do
@@ -190,9 +190,9 @@ changeCurrencySymbol u = do
190
190
utxos <- utxoAt beneficiary
191
191
wrongUtxos <- utxoAt user
192
192
let [(ref, out)] = utxos
193
- [(wRef, wOut )] = wrongUtxos
194
- typedPolicy = script2 ref " "
195
- wrongTypedPolicy = script2 wRef " "
193
+ [(wRef, _ )] = wrongUtxos
194
+ typedPolicy = script2 ref
195
+ wrongTypedPolicy = script2 wRef
196
196
wrongMintingValue = singleton (scriptCurrencySymbol wrongTypedPolicy) " " 1
197
197
valueInOutput = txOutValue out
198
198
checkBalance (owns beneficiary wrongMintingValue) $ do
@@ -202,12 +202,12 @@ comsumeAnotherUTxO :: Run ()
202
202
comsumeAnotherUTxO = do
203
203
user <- newUser $ ada $ Lovelace 1000
204
204
utxos <- utxoAt user
205
- let [(ref, out )] = utxos
205
+ let [(ref, _ )] = utxos
206
206
submitTx user $ splitUTxOTx user ref
207
207
utxos' <- utxoAt user
208
208
case utxos' of
209
- [(ref',out'),(wRef,wOut )] -> do
210
- let typedPolicy = script2 ref' " "
209
+ [(ref',out'),(wRef,_ )] -> do
210
+ let typedPolicy = script2 ref'
211
211
mintingValue = singleton (scriptCurrencySymbol typedPolicy) " " 1
212
212
valueInOutput = txOutValue out'
213
213
submitTx user $ mintingNFTTx wRef typedPolicy mintingValue valueInOutput user
@@ -217,13 +217,13 @@ twoNFTs :: Run ()
217
217
twoNFTs = do
218
218
user <- newUser $ ada $ Lovelace 1000
219
219
utxos <- utxoAt user
220
- let [(ref, out )] = utxos
220
+ let [(ref, _ )] = utxos
221
221
submitTx user $ splitUTxOTx user ref
222
222
utxos' <- utxoAt user
223
223
case utxos' of
224
224
[(ref1,out1),(ref2,out2)] -> do
225
- let typedPolicy1 = script2 ref1 " "
226
- typedPolicy2 = script2 ref2 " "
225
+ let typedPolicy1 = script2 ref1
226
+ typedPolicy2 = script2 ref2
227
227
mintingValue1 = singleton (scriptCurrencySymbol typedPolicy1) " " 1
228
228
mintingValue2 = singleton (scriptCurrencySymbol typedPolicy2) " " 1
229
229
valueInOutput1 = txOutValue out1
@@ -245,4 +245,5 @@ splitUTxOTx pkh txOutRef= mconcat
245
245
[ payToKey pkh (ada (Lovelace 500 ))
246
246
, payToKey pkh (ada (Lovelace 500 ))
247
247
, spendPubKey txOutRef
248
- ]
248
+ ]
249
+
0 commit comments