Skip to content

swap resume: accepts empty/whitespace --from-tx-hash and submits invalid confirm proof #166

@claytonlin1110

Description

@claytonlin1110

Summary

resume does not validate transaction hash after stripping whitespace.

In allways/cli/swap_commands/resume.py:

from_tx_hash = from_tx_hash_opt.strip()
accepted, queued = sign_and_broadcast_confirm(
    ...
    from_tx_hash,
    ...
)

There is no if not from_tx_hash check after .strip().

Why this is a real bug

If user passes whitespace hash (e.g. --from-tx-hash " "), code converts it to "" and still proceeds to sign_and_broadcast_confirm, generating proof message allways-swap: with an empty tx hash.

So the command deterministically tries to confirm with an invalid tx hash instead of failing fast.

Reproduction

  • Run: alw swap resume --from-tx-hash " " --yes
  • Observe command proceeds to “Confirming with validators...”
  • It sends confirmation attempt with empty tx hash instead of rejecting input locally.

Expected behavior

CLI should reject empty/whitespace tx hash immediately with a clear error, same as post-tx flow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions