Skip to content

Commit 7ab8b5e

Browse files
committed
Adds get_coldkey_swap_schedule_duration call
1 parent f3826b1 commit 7ab8b5e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

bittensor_cli/src/bittensor/subtensor_interface.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,3 +1526,28 @@ async def get_scheduled_coldkey_swap(
15261526
async for ss58, _ in result:
15271527
keys_pending_swap.append(decode_account_id(ss58))
15281528
return keys_pending_swap
1529+
1530+
async def get_coldkey_swap_schedule_duration(
1531+
self,
1532+
block_hash: Optional[str] = None,
1533+
reuse_block: bool = False,
1534+
) -> int:
1535+
"""
1536+
Retrieves the duration (in blocks) required for a coldkey swap to be executed.
1537+
1538+
Args:
1539+
block_hash: The hash of the blockchain block number for the query.
1540+
reuse_block: Whether to reuse the last-used blockchain block hash.
1541+
1542+
Returns:
1543+
int: The number of blocks required for the coldkey swap schedule duration.
1544+
"""
1545+
result = await self.query(
1546+
module="SubtensorModule",
1547+
storage_function="ColdkeySwapScheduleDuration",
1548+
params=[],
1549+
block_hash=block_hash,
1550+
reuse_block_hash=reuse_block,
1551+
)
1552+
1553+
return result

0 commit comments

Comments
 (0)