Skip to content

Commit

Permalink
add get_out_msg_queue_sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
yungwine committed Apr 8, 2024
1 parent 92e203e commit b4a69db
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytoniq/liteclient/balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ async def get_config_params(self, params: typing.List[int], blk: typing.Optional
async def get_libraries(self, library_list: typing.List[typing.Union[bytes, str]], **kwargs) -> typing.Dict[str, typing.Optional[Cell]]:
return await self.execute_method('get_libraries', **self._get_args(locals()))

async def get_out_msg_queue_sizes(self, wc: int = None, shard: int = None, **kwargs):
return await self.execute_method('get_out_msg_queue_sizes', **self._get_args(locals()))

async def get_shard_block_proof(self, blk: BlockIdExt, prove_mc: bool = False, **kwargs):
return await self.execute_method('get_shard_block_proof', **self._get_args(locals()))

Expand Down
14 changes: 14 additions & 0 deletions pytoniq/liteclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,20 @@ async def get_libraries(self, library_list: typing.List[typing.Union[bytes, str]

return result

async def get_out_msg_queue_sizes(self, wc: int = None, shard: int = None):
"""
If wc and shard are not None, returns queue size for all children shards of the provided shard.
If both are None, returns queue size for all shards for all workchains.
"""
data = {}
mode = 0b00
assert not (wc is None) ^ (shard is None), 'workchain and shard must be both set or both not set'
if wc is not None or shard is not None:
data['wc'] = wc
data['shard'] = shard
mode += 0b01
return await self.liteserver_request('getOutMsgQueueSizes', data | {'mode': mode})

async def get_shard_block_proof(self, blk: BlockIdExt, prove_mc: bool = False):
data = {'id': blk.to_dict()}

Expand Down

0 comments on commit b4a69db

Please sign in to comment.