diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index 0f70f93642..f03daf4292 100644 --- a/bindings/nodejs/lib/types/block/output/unlock-condition.ts +++ b/bindings/nodejs/lib/types/block/output/unlock-condition.ts @@ -156,8 +156,8 @@ class TimelockUnlockCondition extends UnlockCondition { } /** - * Defines an expiration slot index. Before the slot index is reached, only the Address defined in the Address - * Unlock Condition is allowed to unlock the output. Afterward, only the Return Address can unlock it. + * Defines a slot index until which only the Address defined in the Address Unlock Condition is allowed to unlock the output. + * After the slot index is reached/passed, only the Return Address can unlock it. */ class ExpirationUnlockCondition extends UnlockCondition { /** @@ -168,8 +168,7 @@ class ExpirationUnlockCondition extends UnlockCondition { }) readonly returnAddress: Address; /** - * Before this slot index, the condition is allowed to unlock the output, - * after that only the address defined in return address. + * Before this slot index, the Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address can. */ readonly slotIndex: SlotIndex; diff --git a/bindings/python/examples/client/build_basic.py b/bindings/python/examples/client/build_basic.py index 5ce0101ed5..455ec49084 100644 --- a/bindings/python/examples/client/build_basic.py +++ b/bindings/python/examples/client/build_basic.py @@ -62,7 +62,7 @@ address_unlock_condition, ExpirationUnlockCondition( return_address=Ed25519Address(hex_address), - unix_time=1 + slot_index=1 ) ], amount=1000000, diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 269383255a..f45f102625 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -6,7 +6,7 @@ from typing import Dict, List, TypeAlias, Union, Any from dataclasses_json import config from iota_sdk.types.address import Address, AccountAddress -from iota_sdk.types.common import json +from iota_sdk.types.common import json, SlotIndex from iota_sdk.types.address import deserialize_address @@ -71,11 +71,11 @@ class StorageDepositReturnUnlockCondition: @json @dataclass class TimelockUnlockCondition: - """A timelock unlock condition. + """Defines a slot index until which the output can not be unlocked. Args: - unix_time: The Unix timestamp marking the end of the timelock. + slot_index: Slot index that defines when the output can be consumed. """ - unix_time: int + slot_index: SlotIndex type: int = field( default_factory=lambda: int( UnlockConditionType.Timelock), @@ -85,12 +85,13 @@ class TimelockUnlockCondition: @json @dataclass class ExpirationUnlockCondition: - """An expiration unlock condition. + """Defines a slot index until which only the Address defined in the Address Unlock Condition is allowed to unlock the output. After the slot index is reached/passed, only the Return Address can unlock it. Args: - unix_time: Unix timestamp marking the expiration of the claim. + slot_index: Before this slot index, Address Unlock Condition is allowed to unlock the output, + after that only the address defined in Return Address. return_address: The return address if the output was not claimed in time. """ - unix_time: int + slot_index: SlotIndex return_address: Address = field( metadata=config( decoder=deserialize_address diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index c37a59580c..a02c54279d 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -174,12 +174,12 @@ def test_basic_block_with_tx_payload_all_output_types(): "type": 0, "address": { "type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, { "type": 3, "returnAddress": { - "type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "unixTime": 1}]}, { + "type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}, "slotIndex": 1}]}, { "type": 3, "amount": "1000000", "unlockConditions": [ { "type": 0, "address": { "type": 0, "pubKeyHash": "0x7ffec9e1233204d9c6dce6812b1539ee96af691ca2e4d9065daa85907d33e5d3"}}, { - "type": 2, "unixTime": 1}]}, { + "type": 2, "slotIndex": 1}]}, { "type": 3, "amount": "5578452198", "nativeTokens": [ { "id": "0x080021bcfa2252a500348f73c939722d65c0354eab33b753ab09bc80a7f592c9a40100000000", "amount": "0x41"}, { diff --git a/bindings/python/tests/test_output.py b/bindings/python/tests/test_output.py index 2ec6918444..1d1ff0d4ad 100644 --- a/bindings/python/tests/test_output.py +++ b/bindings/python/tests/test_output.py @@ -74,7 +74,7 @@ def test_output(): "type": 0, "pubKeyHash": "0x8f463f0c57b86cf52cc69542fb43a2ec87f83b9c47493cce04c1a4616716bed0" }, - "unixTime": 1659119101 + "slotIndex": 1659119101 } ] } @@ -101,7 +101,7 @@ def test_output(): }, { "type": 2, - "unixTime": 1661850262 + "slotIndex": 1661850262 } ] }