Skip to content

Commit

Permalink
add nonfinal methods
Browse files Browse the repository at this point in the history
  • Loading branch information
yungwine committed Apr 10, 2024
1 parent b4a69db commit 7f6e5d5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion pytoniq/liteclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,14 +1064,31 @@ async def get_out_msg_queue_sizes(self, wc: int = None, shard: int = None):
If both are None, returns queue size for all shards for all workchains.
"""
data = {}
mode = 0b00
mode = 0b0
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 nonfinal_get_validator_groups(self, wc: int = None, shard: int = None):
data = {}
mode = 0b0
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 = 3
return await self.liteserver_request('nonfinal.getValidatorGroups', data | {'mode': mode})

async def nonfinal_raw_get_candidate(self, candidate_id: dict):
return await self.liteserver_request('nonfinal.getCandidate', {'id': candidate_id})

async def nonfinal_get_candidate(self, candidate_id: dict):
resp = await self.nonfinal_raw_get_candidate(candidate_id)
return Block.deserialize(Slice.one_from_boc(resp['data']))

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

Expand Down

0 comments on commit 7f6e5d5

Please sign in to comment.