Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/python: unlock slotindex #1393

Merged
merged 14 commits into from
Oct 10, 2023
2 changes: 1 addition & 1 deletion bindings/python/examples/client/build_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
address_unlock_condition,
ExpirationUnlockCondition(
return_address=Ed25519Address(hex_address),
unix_time=1
slot_index=1
)
],
amount=1000000,
Expand Down
11 changes: 6 additions & 5 deletions bindings/python/iota_sdk/types/unlock_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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


Expand Down Expand Up @@ -79,9 +79,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.
thibault-martinez marked this conversation as resolved.
Show resolved Hide resolved
"""
unix_time: int
slot_index: SlotIndex
type: int = field(
default_factory=lambda: int(
UnlockConditionType.Timelock),
Expand All @@ -93,10 +93,11 @@ class TimelockUnlockCondition(UnlockCondition):
class ExpirationUnlockCondition(UnlockCondition):
"""An expiration unlock condition.
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: AddressUnion = field(
metadata=config(
decoder=deserialize_address
Expand Down