Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions bittensor/core/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ async def sync(
await self._set_weights_and_bonds(subtensor=subtensor)

# Fills in the stake associated attributes of a class instance from a chain response.
await self._get_all_stakes_from_chain()
await self._get_all_stakes_from_chain(block=block)

# apply MetagraphInfo data to instance
await self._apply_metagraph_info()
Expand Down Expand Up @@ -1566,13 +1566,14 @@ async def _process_root_weights(
)
return tensor_param

async def _get_all_stakes_from_chain(self):
async def _get_all_stakes_from_chain(self, block: int):
"""Fills in the stake associated attributes of a class instance from a chain response."""
try:
result = await self.subtensor.query_runtime_api(
runtime_api="SubnetInfoRuntimeApi",
method="get_subnet_state",
params=[self.netuid],
block=block,
)

if result is None:
Expand Down Expand Up @@ -1713,7 +1714,7 @@ def sync(
self._set_weights_and_bonds(subtensor=subtensor)

# Fills in the stake associated attributes of a class instance from a chain response.
self._get_all_stakes_from_chain()
self._get_all_stakes_from_chain(block=block)

# apply MetagraphInfo data to instance
self._apply_metagraph_info()
Expand Down Expand Up @@ -1873,13 +1874,14 @@ def _process_root_weights(
)
return tensor_param

def _get_all_stakes_from_chain(self):
def _get_all_stakes_from_chain(self, block: int):
"""Fills in the stake associated attributes of a class instance from a chain response."""
try:
result = self.subtensor.query_runtime_api(
runtime_api="SubnetInfoRuntimeApi",
method="get_subnet_state",
params=[self.netuid],
block=block,
)

if result is None:
Expand Down
Loading