Skip to content

Commit

Permalink
align to timelock updates
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Jan 28, 2021
1 parent a154fac commit 1ff6fa8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/core/test/unit/Cardano/Wallet/Api/TypesSpec.hs
Expand Up @@ -1066,8 +1066,8 @@ instance Arbitrary Script where
where
scriptTree 0 = oneof
[ RequireSignatureOf <$> arbitrary
, ValidFromSlot <$> arbitrary
, ValidFromSlot <$> arbitrary ]
, ActiveFromSlot <$> arbitrary
, ActiveFromSlot <$> arbitrary ]
scriptTree n = do
Positive m <- arbitrary
let n' = n `div` (m + 1)
Expand Down
Expand Up @@ -445,18 +445,18 @@ testScriptsTimelockLang = do
let toSimpleScript = Cardano.SimpleScript Cardano.SimpleScriptV2

let matrix =
[ ( "SimpleScriptV2 ValidFromSlot"
, RequireAllOf [toKeyHash hashKeyTxt1, ValidFromSlot 120]
[ ( "SimpleScriptV2 ActiveFromSlot"
, RequireAllOf [toKeyHash hashKeyTxt1, ActiveFromSlot 120]
, toSimpleScript $
Cardano.RequireAllOf [toPaymentHash hashKeyTxt1, Cardano.RequireTimeAfter Cardano.TimeLocksInSimpleScriptV2 (SlotNo 120)]
)
, ( "SimpleScriptV2 ValidUntilSlot"
, RequireAllOf [toKeyHash hashKeyTxt1, ValidUntilSlot 120]
, ( "SimpleScriptV2 ActiveUntilSlot"
, RequireAllOf [toKeyHash hashKeyTxt1, ActiveUntilSlot 120]
, toSimpleScript $
Cardano.RequireAllOf [toPaymentHash hashKeyTxt1, Cardano.RequireTimeBefore Cardano.TimeLocksInSimpleScriptV2 (SlotNo 120)]
)
, ( "SimpleScriptV2 ValidFromSlot and ValidUntilSlot"
, RequireAllOf [ValidFromSlot 120, ValidUntilSlot 150, RequireAnyOf [toKeyHash hashKeyTxt1, toKeyHash hashKeyTxt2]]
, ( "SimpleScriptV2 ActiveFromSlot and ActiveUntilSlot"
, RequireAllOf [ActiveFromSlot 120, ActiveUntilSlot 150, RequireAnyOf [toKeyHash hashKeyTxt1, toKeyHash hashKeyTxt2]]
, toSimpleScript $
Cardano.RequireAllOf
[ Cardano.RequireTimeAfter Cardano.TimeLocksInSimpleScriptV2 (SlotNo 120)
Expand Down
12 changes: 6 additions & 6 deletions specifications/api/swagger.yaml
Expand Up @@ -387,22 +387,22 @@ x-ScriptValue: &ScriptValue
items:
$ref: "#/components/schemas/ScriptValue"

- title: Valid from
- title: Active from
type: object
required:
- valid_from
- active_from
properties:
valid_from:
active_from:
description: Transaction has to occur no sooner than a specified slot number.
type: integer
minimum: 0

- title: Valid until
- title: Active until
type: object
required:
- valid_until
- active_until
properties:
valid_from:
active_until:
description: Transaction has to occur before a specified slot number.
type: integer
minimum: 0
Expand Down

0 comments on commit 1ff6fa8

Please sign in to comment.