From a79ca98a3e365c5b85d2e9975758226a92235d70 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 4 Oct 2023 18:20:58 +0200 Subject: [PATCH 01/11] rename --- bindings/python/examples/client/build_basic.py | 2 +- bindings/python/iota_sdk/types/unlock_condition.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) 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 6676f9681b..757f9b0071 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -6,10 +6,9 @@ from typing import Dict, List, TypeAlias, Union, Any from dataclasses_json import config from iota_sdk.types.address import AddressUnion, AccountAddress -from iota_sdk.types.common import json +from iota_sdk.types.common import json, SlotIndex from iota_sdk.types.address import deserialize_address - class UnlockConditionType(IntEnum): """Unlock condition variants. @@ -79,9 +78,9 @@ class StorageDepositReturnUnlockCondition(UnlockCondition): class TimelockUnlockCondition(UnlockCondition): """A timelock unlock condition. Args: - unix_time: The Unix timestamp marking the end of the timelock. + slot_index: The slot index that determines when the associated output expires. """ - unix_time: int + slot_index: SlotIndex type: int = field( default_factory=lambda: int( UnlockConditionType.Timelock), @@ -93,10 +92,10 @@ class TimelockUnlockCondition(UnlockCondition): class ExpirationUnlockCondition(UnlockCondition): """An expiration unlock condition. Args: - unix_time: Unix timestamp marking the expiration of the claim. + slot_index: The slot index that determines when the associated output expires. return_address: The return address if the output was not claimed in time. """ - unix_time: int + slot_index: SlotIndex return_address: AddressUnion = field( metadata=config( decoder=deserialize_address From 693a86ddfa06ecc9e55377189e9d4d8bc3a36835 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 4 Oct 2023 18:25:45 +0200 Subject: [PATCH 02/11] this 2 line nonsense is weird --- bindings/python/iota_sdk/types/unlock_condition.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 757f9b0071..39493c7cf1 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -9,6 +9,7 @@ from iota_sdk.types.common import json, SlotIndex from iota_sdk.types.address import deserialize_address + class UnlockConditionType(IntEnum): """Unlock condition variants. From 5ddec0045af0fea0bb8b2cedcf603555f8b7bb53 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 4 Oct 2023 21:12:08 +0200 Subject: [PATCH 03/11] expiration fix --- bindings/python/iota_sdk/types/unlock_condition.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 39493c7cf1..6cbdbadf17 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -93,7 +93,8 @@ class TimelockUnlockCondition(UnlockCondition): class ExpirationUnlockCondition(UnlockCondition): """An expiration unlock condition. Args: - slot_index: The slot index that determines when the associated output expires. + 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. """ slot_index: SlotIndex From 69d93d188659e585623cfc6c83e871d878c5bb2b Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Wed, 4 Oct 2023 21:17:57 +0200 Subject: [PATCH 04/11] spaced out --- bindings/python/iota_sdk/types/unlock_condition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 6cbdbadf17..48638f89ac 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -93,7 +93,7 @@ class TimelockUnlockCondition(UnlockCondition): class ExpirationUnlockCondition(UnlockCondition): """An expiration unlock condition. Args: - slot_index: Before this slot index, Address Unlock Condition is allowed to unlock the output, + 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. """ From bd094142feeeee61e686c76b61931b05fdd6339e Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 5 Oct 2023 12:48:55 +0200 Subject: [PATCH 05/11] test --- bindings/python/tests/test_block.py | 4 ++-- bindings/python/tests/test_output.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/python/tests/test_block.py b/bindings/python/tests/test_block.py index ad9f651e5f..ab98c985f7 100644 --- a/bindings/python/tests/test_block.py +++ b/bindings/python/tests/test_block.py @@ -168,12 +168,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 } ] } From c2aec27121b3c9d71f1c6455c877dbab687171ed Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 5 Oct 2023 18:17:40 +0200 Subject: [PATCH 06/11] . --- bindings/nodejs/lib/types/block/output/unlock-condition.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index 0f70f93642..952194e817 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 Address, defined in Address Unlock Condition, is allowed to unlock the output. + * After the slot index is reached/passed, only 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, Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address. */ readonly slotIndex: SlotIndex; From dcac0b5ae541a6a2e2295c0f9b85aa17b54b1616 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 5 Oct 2023 18:25:57 +0200 Subject: [PATCH 07/11] .. --- bindings/python/iota_sdk/types/unlock_condition.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 09510895b0..2a5172a767 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -69,9 +69,9 @@ class StorageDepositReturnUnlockCondition: @json @dataclass class TimelockUnlockCondition: - """A timelock unlock condition. + """Defines a slot index until which the output can not be unlocked. Args: - slot_index: The slot index that determines when the associated output expires. + slot_index: Slot index starting from which the output can be consumed. """ slot_index: SlotIndex type: int = field( @@ -83,7 +83,7 @@ class TimelockUnlockCondition: @json @dataclass class ExpirationUnlockCondition: - """An expiration unlock condition. + """Defines a slot index until which only Address, defined in Address Unlock Condition, is allowed to unlock the output. After the slot index is reached/passed, only Return Address can unlock it. Args: slot_index: Before this slot index, Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address. From 0a1819d162d952f346c10b98a7a8d8cd6b8e4495 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Fri, 6 Oct 2023 01:30:08 +0200 Subject: [PATCH 08/11] Update bindings/python/iota_sdk/types/unlock_condition.py Co-authored-by: DaughterOfMars --- bindings/python/iota_sdk/types/unlock_condition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 2a5172a767..57491aee87 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -83,7 +83,7 @@ class TimelockUnlockCondition: @json @dataclass class ExpirationUnlockCondition: - """Defines a slot index until which only Address, defined in Address Unlock Condition, is allowed to unlock the output. After the slot index is reached/passed, only 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. Args: slot_index: Before this slot index, Address Unlock Condition is allowed to unlock the output, after that only the address defined in Return Address. From 00fba6b6656666717c2f46ced64ecfb035b6b9dd Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Mon, 9 Oct 2023 12:35:41 +0200 Subject: [PATCH 09/11] als oin ts --- bindings/nodejs/lib/types/block/output/unlock-condition.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index 952194e817..50f96f39a3 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 a slot index until which only Address, defined in Address Unlock Condition, is allowed to unlock the output. - * After the slot index is reached/passed, only 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 { /** From 35caf11a576862227068b842c85970ec130d6206 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 10 Oct 2023 16:48:52 +0200 Subject: [PATCH 10/11] Update bindings/nodejs/lib/types/block/output/unlock-condition.ts Co-authored-by: DaughterOfMars --- bindings/nodejs/lib/types/block/output/unlock-condition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index 50f96f39a3..f03daf4292 100644 --- a/bindings/nodejs/lib/types/block/output/unlock-condition.ts +++ b/bindings/nodejs/lib/types/block/output/unlock-condition.ts @@ -168,7 +168,7 @@ class ExpirationUnlockCondition extends UnlockCondition { }) readonly returnAddress: Address; /** - * Before this slot index, Address Unlock 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; From 0739789e7a3bcdb1e7d1d2a81f9322f501552f17 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Tue, 10 Oct 2023 16:49:03 +0200 Subject: [PATCH 11/11] Update bindings/python/iota_sdk/types/unlock_condition.py Co-authored-by: DaughterOfMars --- bindings/python/iota_sdk/types/unlock_condition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/iota_sdk/types/unlock_condition.py b/bindings/python/iota_sdk/types/unlock_condition.py index 7729f967ae..f45f102625 100644 --- a/bindings/python/iota_sdk/types/unlock_condition.py +++ b/bindings/python/iota_sdk/types/unlock_condition.py @@ -73,7 +73,7 @@ class StorageDepositReturnUnlockCondition: class TimelockUnlockCondition: """Defines a slot index until which the output can not be unlocked. Args: - slot_index: Slot index starting from which the output can be consumed. + slot_index: Slot index that defines when the output can be consumed. """ slot_index: SlotIndex type: int = field(