@@ -1400,7 +1400,7 @@ async def sync(
1400
1400
await self ._set_weights_and_bonds (subtensor = subtensor )
1401
1401
1402
1402
# Fills in the stake associated attributes of a class instance from a chain response.
1403
- await self ._get_all_stakes_from_chain ()
1403
+ await self ._get_all_stakes_from_chain (block = block )
1404
1404
1405
1405
# apply MetagraphInfo data to instance
1406
1406
await self ._apply_metagraph_info ()
@@ -1566,13 +1566,14 @@ async def _process_root_weights(
1566
1566
)
1567
1567
return tensor_param
1568
1568
1569
- async def _get_all_stakes_from_chain (self ):
1569
+ async def _get_all_stakes_from_chain (self , block : int ):
1570
1570
"""Fills in the stake associated attributes of a class instance from a chain response."""
1571
1571
try :
1572
1572
result = await self .subtensor .query_runtime_api (
1573
1573
runtime_api = "SubnetInfoRuntimeApi" ,
1574
1574
method = "get_subnet_state" ,
1575
1575
params = [self .netuid ],
1576
+ block = block ,
1576
1577
)
1577
1578
1578
1579
if result is None :
@@ -1713,7 +1714,7 @@ def sync(
1713
1714
self ._set_weights_and_bonds (subtensor = subtensor )
1714
1715
1715
1716
# Fills in the stake associated attributes of a class instance from a chain response.
1716
- self ._get_all_stakes_from_chain ()
1717
+ self ._get_all_stakes_from_chain (block = block )
1717
1718
1718
1719
# apply MetagraphInfo data to instance
1719
1720
self ._apply_metagraph_info ()
@@ -1873,13 +1874,14 @@ def _process_root_weights(
1873
1874
)
1874
1875
return tensor_param
1875
1876
1876
- def _get_all_stakes_from_chain (self ):
1877
+ def _get_all_stakes_from_chain (self , block : int ):
1877
1878
"""Fills in the stake associated attributes of a class instance from a chain response."""
1878
1879
try :
1879
1880
result = self .subtensor .query_runtime_api (
1880
1881
runtime_api = "SubnetInfoRuntimeApi" ,
1881
1882
method = "get_subnet_state" ,
1882
1883
params = [self .netuid ],
1884
+ block = block ,
1883
1885
)
1884
1886
1885
1887
if result is None :
0 commit comments