Skip to content

btcli wallet swap-check missing time remaining and swap details when block number not provided #484

@distributedstatemachine

Description

@distributedstatemachine

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

  1. Run btcli wallet swap-check
  2. Enter a wallet name that has a pending swap (e.g., "foo")
  3. Press enter when prompted for block number (leave blank)
  4. Observe that the command finds the pending swap and shows "Scheduled at block: X" but stops there
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions