-
Notifications
You must be signed in to change notification settings - Fork 74
Description
Description
When running btcli wallet swap-check without providing the block number where the swap was scheduled, the command finds the pending swap and displays the scheduled block number, but fails to query the archive node for complete swap details including time remaining. The command stops after showing "Scheduled at block: X" instead of continuing to fetch and display the full coldkey swap details.
To Reproduce
- Run
btcli wallet swap-check - Enter a wallet name that has a pending swap (e.g., "foo")
- Press enter when prompted for block number (leave blank)
- Observe that the command finds the pending swap and shows "Scheduled at block: X" but stops there
- Compare with running the same command but providing the block number - it then shows complete details including "Time remaining: Xd Xh"
Expected behavior
When not providing the block number, the command should still query the archive node and display complete coldkey swap details including:
- Scheduled at block
- Original address
- Destination address
- Completion block
- Time remaining
The behavior should be identical whether the block number is provided manually or discovered automatically.
Screenshots
Without block number (incomplete output):
$ btcli wallet swap-check
Using the specified network finney from config
Enter wallet name or SS58 address (leave blank to show all pending swaps): t_slice
Enter the block number where the swap was scheduled (optional, press enter to skip) ():
Found pending swap for coldkey: 5D78M1koYkWe3sknQ1NANbTu1vcRsWtmWAEcvCvQJhJoZmxN
With block number (complete output):
$ btcli wallet swap-check
Using the specified network finney from config
Enter wallet name or SS58 address (leave blank to show all pending swaps): t_slice
Enter the block number where the swap was scheduled (optional, press enter to skip) (): 5702436
Found pending swap for coldkey: 5D78M1koYkWe3sknQ1NANbTu1vcRsWtmWAEcvCvQJhJoZmxN
Querying archive node for coldkey swap events...
Coldkey swap details:
Scheduled at block: 5702436
Original address: 5D78M1koYkWe3sknQ1NANbTu1vcRsWtmWAEcvCvQJhJoZmxN
Destination address: 5D7Rf7HbeE7ti49fyLg3TM3F96uWFUwzYBo9SkzBpAUTQMhM
Completion block: 5738436
Time remaining: 2d 11h
Environment
OS and Distro: macOS
Bittensor Version: [latest from btcli main branch]
Additional context
The issue appears to be in the swap-check logic where the command successfully discovers the scheduled block number but doesn't automatically proceed to query the archive node with that discovered block number. The archive node query and detailed swap information display only occurs when the block number is explicitly provided by the user.
This creates an inconsistent user experience where users must run the command twice - once to discover the block number, then again with that block number to get the complete information.