Skip to content

Commit 681540a

Browse files
committed
Replace SimpleScriptV1 and SimpleScriptV2 type level tags with
SimpleScript' Remove type variable from SimpleScript data declaration
1 parent e299e80 commit 681540a

File tree

6 files changed

+189
-373
lines changed

6 files changed

+189
-373
lines changed

cardano-api/gen/Gen/Cardano/Api/Typed.hs

+8-12
Original file line numberDiff line numberDiff line change
@@ -179,27 +179,23 @@ genLovelace = Lovelace <$> Gen.integral (Range.linear 0 5000)
179179
--
180180

181181
genScript :: ScriptLanguage lang -> Gen (Script lang)
182-
genScript (SimpleScriptLanguage lang) =
183-
SimpleScript lang <$> genSimpleScript lang
182+
genScript SimpleScriptLanguage =
183+
SimpleScript <$> genSimpleScript
184184
genScript (PlutusScriptLanguage lang) =
185185
PlutusScript lang <$> genPlutusScript lang
186186

187-
genSimpleScript :: SimpleScriptVersion lang -> Gen (SimpleScript lang)
188-
genSimpleScript lang =
187+
genSimpleScript :: Gen SimpleScript
188+
genSimpleScript =
189189
genTerm
190190
where
191191
genTerm = Gen.recursive Gen.choice nonRecursive recursive
192192

193193
-- Non-recursive generators
194194
nonRecursive =
195-
(RequireSignature . verificationKeyHash <$>
196-
genVerificationKey AsPaymentKey)
197-
198-
: [ RequireTimeBefore supported <$> genSlotNo
199-
| supported <- maybeToList (timeLocksSupported lang) ]
200-
201-
++ [ RequireTimeAfter supported <$> genSlotNo
202-
| supported <- maybeToList (timeLocksSupported lang) ]
195+
[ RequireSignature . verificationKeyHash <$> genVerificationKey AsPaymentKey
196+
, RequireTimeBefore <$> genSlotNo
197+
, RequireTimeAfter <$> genSlotNo
198+
]
203199

204200
-- Recursive generators
205201
recursive =

cardano-api/src/Cardano/Api.hs

+1-7
Original file line numberDiff line numberDiff line change
@@ -336,18 +336,15 @@ module Cardano.Api (
336336
-- | Both 'PaymentCredential's and 'StakeCredential's can use scripts.
337337

338338
-- ** Script languages
339-
SimpleScriptV1,
340-
SimpleScriptV2,
339+
SimpleScript',
341340
PlutusScriptV1,
342341
PlutusScriptV2,
343342
ScriptLanguage(..),
344-
SimpleScriptVersion(..),
345343
PlutusScriptVersion(..),
346344
AnyScriptLanguage(..),
347345
AnyPlutusScriptVersion(..),
348346
IsPlutusScriptLanguage(..),
349347
IsScriptLanguage(..),
350-
IsSimpleScriptLanguage(..),
351348

352349
-- ** Scripts in a specific language
353350
Script(..),
@@ -388,9 +385,6 @@ module Cardano.Api (
388385
-- ** Simple scripts
389386
-- | Making multi-signature and time-lock scripts.
390387
SimpleScript(..),
391-
TimeLocksSupported(..),
392-
timeLocksSupported,
393-
adjustSimpleScriptVersion,
394388

395389
-- ** Plutus scripts
396390
PlutusScript,

0 commit comments

Comments
 (0)