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

AttributeError: 'NoneType' object has no attribute 'seqno' with trust_level 0 #33

Open
QuisEgoSum opened this issue Jul 23, 2024 · 0 comments

Comments

@QuisEgoSum
Copy link

QuisEgoSum commented Jul 23, 2024

pytoniq 0.1.39
python 3.11

import asyncio

from pytoniq import LiteClient


async def main():
    client = LiteClient.from_mainnet_config(  # choose mainnet, testnet or custom config dict
        ls_i=0,  # index of liteserver from config
        trust_level=0,  # trust level to liteserver
        timeout=15  # timeout not includes key blocks synchronization as it works in pytonlib
    )

    await client.connect()


if __name__ == '__main__':
    asyncio.run(main())

With some probability I get:

Traceback (most recent call last):
  File "<rootPath>/pytoniq_test.py", line 44, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "<rootPath>/pytoniq_test.py", line 13, in main
    await client.connect()
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytoniq/liteclient/client.py", line 190, in connect
    await self.update_last_blocks()
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytoniq/liteclient/client.py", line 310, in update_last_blocks
    self.last_mc_block = await self.get_trusted_last_mc_block()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytoniq/liteclient/client.py", line 306, in get_trusted_last_mc_block
    await self.get_mc_block_proof(known_block=self.last_key_block, target_block=last_block)
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytoniq/liteclient/client.py", line 982, in get_mc_block_proof
    while last_proved != target_block:
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<rootPath>/.venv/lib/python3.11/site-packages/pytoniq_core/tl/block.py", line 66, in __eq__
    if self.seqno != other.seqno or self.workchain != other.workchain or self.shard != other.shard or self.root_hash != other.root_hash or self.file_hash != other.file_hash:
                     ^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'seqno'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant