File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
bittensor_cli/src/bittensor Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1526,3 +1526,28 @@ async def get_scheduled_coldkey_swap(
1526
1526
async for ss58 , _ in result :
1527
1527
keys_pending_swap .append (decode_account_id (ss58 ))
1528
1528
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
You can’t perform that action at this time.
0 commit comments