@@ -2002,7 +2002,8 @@ async def check_swap_status(
2002
2002
Args:
2003
2003
subtensor: Connection to the network
2004
2004
origin_ss58: The SS58 address of the original coldkey
2005
- block_number: Optional block number where the swap was scheduled
2005
+ expected_block_number: Optional block number where the swap was scheduled
2006
+
2006
2007
"""
2007
2008
2008
2009
if not origin_ss58 :
@@ -2035,7 +2036,8 @@ async def check_swap_status(
2035
2036
2036
2037
console .print (table )
2037
2038
console .print (
2038
- "\n [dim]Tip: Check specific swap details by providing the original coldkey SS58 address and the block number.[/dim]"
2039
+ "\n [dim]Tip: Check specific swap details by providing the original coldkey "
2040
+ "SS58 address and the block number.[/dim]"
2039
2041
)
2040
2042
return
2041
2043
chain_reported_completion_block , destination_address = await subtensor .query (
@@ -2062,31 +2064,17 @@ async def check_swap_status(
2062
2064
if expected_block_number is None :
2063
2065
expected_block_number = chain_reported_completion_block
2064
2066
2065
- swap_info = await find_coldkey_swap_extrinsic (
2066
- subtensor = subtensor ,
2067
- start_block = expected_block_number ,
2068
- end_block = expected_block_number ,
2069
- wallet_ss58 = origin_ss58 ,
2070
- )
2071
-
2072
- if not swap_info :
2073
- console .print (
2074
- f"[yellow]Warning: Could not find swap extrinsic at block { expected_block_number } [/yellow]"
2075
- )
2076
- return
2077
-
2078
2067
current_block = await subtensor .substrate .get_block_number ()
2079
- remaining_blocks = swap_info [ "execution_block" ] - current_block
2068
+ remaining_blocks = expected_block_number - current_block
2080
2069
2081
2070
if remaining_blocks <= 0 :
2082
2071
console .print ("[green]Swap period has completed![/green]" )
2083
2072
return
2084
2073
2085
2074
console .print (
2086
2075
"\n [green]Coldkey swap details:[/green]"
2087
- f"\n Scheduled at block: { swap_info ['block_num' ]} "
2088
2076
f"\n Original address: [{ COLORS .G .CK } ]{ origin_ss58 } [/{ COLORS .G .CK } ]"
2089
- f"\n Destination address: [{ COLORS .G .CK } ]{ swap_info [ 'dest_coldkey' ] } [/{ COLORS .G .CK } ]"
2090
- f"\n Completion block: { swap_info [ 'execution_block' ] } "
2077
+ f"\n Destination address: [{ COLORS .G .CK } ]{ destination_address } [/{ COLORS .G .CK } ]"
2078
+ f"\n Completion block: { chain_reported_completion_block } "
2091
2079
f"\n Time remaining: { blocks_to_duration (remaining_blocks )} "
2092
2080
)
0 commit comments