Skip to content

Commit 1addd3a

Browse files
authored
fix(cluster): owner has wrong type AddressType (#128)
1 parent 832fabe commit 1addd3a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

silverback/cluster/types.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
from datetime import datetime
55
from typing import Annotated, Any
66

7-
from ape.types import AddressType
7+
from ape.types import AddressType, HexBytes
88
from cryptography.exceptions import InvalidSignature
99
from cryptography.hazmat.primitives.hmac import HMAC, hashes
10-
from eth_pydantic_types import Address, HexBytes
1110
from eth_utils import to_bytes, to_int
1211
from pydantic import BaseModel, Field, computed_field, field_validator
1312

@@ -171,7 +170,7 @@ def encode(self) -> int:
171170
+ self._encode_byte(self.duration, 7)
172171
)
173172

174-
def get_product_code(self, owner: Address, cluster_id: uuid.UUID) -> HexBytes:
173+
def get_product_code(self, owner: AddressType, cluster_id: uuid.UUID) -> HexBytes:
175174
# returns bytes32 product code `(sig || config)`
176175
config = normalize_bytes(to_bytes(self.encode()))
177176

@@ -189,7 +188,7 @@ def get_product_code(self, owner: Address, cluster_id: uuid.UUID) -> HexBytes:
189188
return HexBytes(config + sig)
190189

191190
def validate_product_code(
192-
self, owner: Address, signature: bytes, cluster_id: uuid.UUID
191+
self, owner: AddressType, signature: bytes, cluster_id: uuid.UUID
193192
) -> bool:
194193
# NOTE: Put `cluster_id` last so it's easy to use with `functools.partial`
195194
config = normalize_bytes(to_bytes(self.encode()))

0 commit comments

Comments
 (0)