@@ -1400,7 +1400,7 @@ async def sync(
14001400 await self ._set_weights_and_bonds (subtensor = subtensor )
14011401
14021402 # 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 )
14041404
14051405 # apply MetagraphInfo data to instance
14061406 await self ._apply_metagraph_info ()
@@ -1566,13 +1566,14 @@ async def _process_root_weights(
15661566 )
15671567 return tensor_param
15681568
1569- async def _get_all_stakes_from_chain (self ):
1569+ async def _get_all_stakes_from_chain (self , block : int ):
15701570 """Fills in the stake associated attributes of a class instance from a chain response."""
15711571 try :
15721572 result = await self .subtensor .query_runtime_api (
15731573 runtime_api = "SubnetInfoRuntimeApi" ,
15741574 method = "get_subnet_state" ,
15751575 params = [self .netuid ],
1576+ block = block ,
15761577 )
15771578
15781579 if result is None :
@@ -1713,7 +1714,7 @@ def sync(
17131714 self ._set_weights_and_bonds (subtensor = subtensor )
17141715
17151716 # 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 )
17171718
17181719 # apply MetagraphInfo data to instance
17191720 self ._apply_metagraph_info ()
@@ -1873,13 +1874,14 @@ def _process_root_weights(
18731874 )
18741875 return tensor_param
18751876
1876- def _get_all_stakes_from_chain (self ):
1877+ def _get_all_stakes_from_chain (self , block : int ):
18771878 """Fills in the stake associated attributes of a class instance from a chain response."""
18781879 try :
18791880 result = self .subtensor .query_runtime_api (
18801881 runtime_api = "SubnetInfoRuntimeApi" ,
18811882 method = "get_subnet_state" ,
18821883 params = [self .netuid ],
1884+ block = block ,
18831885 )
18841886
18851887 if result is None :
0 commit comments