Skip to content

Commit fa38b7b

Browse files
committed
Replace SimpleScriptV1 and SimpleScriptV2 type level tags with
SimpleScript' Remove type variable from SimpleScript data declaration
1 parent 385c247 commit fa38b7b

File tree

6 files changed

+195
-381
lines changed

6 files changed

+195
-381
lines changed

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

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

187187
genScript :: ScriptLanguage lang -> Gen (Script lang)
188-
genScript (SimpleScriptLanguage lang) =
189-
SimpleScript lang <$> genSimpleScript lang
188+
genScript SimpleScriptLanguage =
189+
SimpleScript <$> genSimpleScript
190190
genScript (PlutusScriptLanguage lang) =
191191
PlutusScript lang <$> genPlutusScript lang
192192

193-
genSimpleScript :: SimpleScriptVersion lang -> Gen (SimpleScript lang)
194-
genSimpleScript lang =
193+
genSimpleScript :: Gen SimpleScript
194+
genSimpleScript =
195195
genTerm
196196
where
197197
genTerm = Gen.recursive Gen.choice nonRecursive recursive
198198

199199
-- Non-recursive generators
200200
nonRecursive =
201-
(RequireSignature . verificationKeyHash <$>
202-
genVerificationKey AsPaymentKey)
203-
204-
: [ RequireTimeBefore supported <$> genSlotNo
205-
| supported <- maybeToList (timeLocksSupported lang) ]
206-
207-
++ [ RequireTimeAfter supported <$> genSlotNo
208-
| supported <- maybeToList (timeLocksSupported lang) ]
201+
[ RequireSignature . verificationKeyHash <$> genVerificationKey AsPaymentKey
202+
, RequireTimeBefore <$> genSlotNo
203+
, RequireTimeAfter <$> genSlotNo
204+
]
209205

210206
-- Recursive generators
211207
recursive =

cardano-api/src/Cardano/Api.hs

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

339339
-- ** Script languages
340-
SimpleScriptV1,
341-
SimpleScriptV2,
340+
SimpleScript',
342341
PlutusScriptV1,
343342
PlutusScriptV2,
344343
ScriptLanguage(..),
345-
SimpleScriptVersion(..),
346344
PlutusScriptVersion(..),
347345
AnyScriptLanguage(..),
348346
AnyPlutusScriptVersion(..),
349347
IsPlutusScriptLanguage(..),
350348
IsScriptLanguage(..),
351-
IsSimpleScriptLanguage(..),
352349

353350
-- ** Scripts in a specific language
354351
Script(..),
@@ -389,9 +386,6 @@ module Cardano.Api (
389386
-- ** Simple scripts
390387
-- | Making multi-signature and time-lock scripts.
391388
SimpleScript(..),
392-
TimeLocksSupported(..),
393-
timeLocksSupported,
394-
adjustSimpleScriptVersion,
395389

396390
-- ** Plutus scripts
397391
PlutusScript,

0 commit comments

Comments
 (0)