Skip to content

Commit

Permalink
return full ShardAccount from raw_get_account_state
Browse files Browse the repository at this point in the history
  • Loading branch information
yungwine committed Feb 27, 2024
1 parent ca8614a commit 628e7c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions pytoniq/liteclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from .sync import choose_key_block, sync
from .utils import init_mainnet_block, init_testnet_block
from pytoniq_core.boc import Slice, Cell
from pytoniq_core.boc import Slice, Cell, begin_cell
from pytoniq_core.proof.check_proof import check_block_header_proof, check_shard_proof, check_account_proof, check_proof, \
check_block_signatures, compute_validator_set
from pytoniq_core.boc.address import Address
Expand Down Expand Up @@ -447,8 +447,10 @@ async def raw_get_account_state(self, address: typing.Union[str, Address],
if not trusted and not self.trust_level:
await self.get_mc_block_proof(known_block=self.last_key_block, target_block=block)
shard_account = check_account_proof(proof=result['proof'], shrd_blk=shrd_blk, address=address, account_state_root=account_state_root, return_account_descr=True)
account = Account.deserialize(account_state_root.begin_parse())
full_shard_account_cell = begin_cell().store_bytes(shard_account.cell.begin_parse().load_bytes(40)).store_ref(account_state_root).end_cell()

return Account.deserialize(account_state_root.begin_parse()), shard_account
return account, ShardAccount.deserialize(full_shard_account_cell.begin_parse())

async def get_account_state(self, address: typing.Union[str, Address]) -> SimpleAccount:
"""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pytoniq",
version="0.1.32",
version="0.1.33",
author="Maksim Kurbatov",
author_email="[email protected]",
description="TON Blockchain SDK",
Expand All @@ -22,7 +22,7 @@
python_requires='>=3.9',
py_modules=["pytoniq"],
install_requires=[
"pytoniq-core>=0.1.23",
"pytoniq-core>=0.1.31",
"requests>=2.31.0",
"setuptools>=65.5.1",
]
Expand Down

0 comments on commit 628e7c8

Please sign in to comment.