Skip to content

Commit

Permalink
raw attribute and __hash__ implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Vaysberg committed Jan 21, 2025
1 parent dfb354e commit 6131bd9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def finalize_options(self):

setup(
name="tonpy" if not IS_DEV else "tonpy-dev",
version="0.0.0.1.2c0" if not IS_DEV else "0.0.0.5.5b1",
version="0.0.0.1.2c0" if not IS_DEV else "0.0.0.5.5c1",
author="Disintar LLP",
author_email="andrey@head-labs.com",
description="Types / API for TON blockchain",
Expand Down
11 changes: 11 additions & 0 deletions src/tonpy/types/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ def testnet(self) -> bool:

return self.my_address.testnet

@property
def raw(self) -> Union[None, str]:
if self.my_address is None:
return None

return f"{self.wc}:{self.address}"

@testnet.setter
def testnet(self, flag: bool):
if self.my_address is None:
Expand Down Expand Up @@ -127,3 +134,7 @@ def __str__(self):

def __repr__(self):
return f'<Address value="{self.serialize()}">'

def __hash__(self):
return int(f"{self.wc}{self.address}", 16)

0 comments on commit 6131bd9

Please sign in to comment.