Description
Severity: S3 (UX — gratuitous rejection of a reasonable invocation)
Location: allways/cli/swap_commands/swap.py:603-608
if from_chain_opt and from_chain_opt not in SUPPORTED_CHAINS:
console.print(f'[red]Unknown source chain: {from_chain_opt}[/red]')
return
if to_chain_opt and to_chain_opt not in SUPPORTED_CHAINS:
console.print(f'[red]Unknown destination chain: {to_chain_opt}[/red]')
return
SUPPORTED_CHAINS keys are lowercase (chains.py:40-43). Sister commands already lowercase before validating:
Only alw swap now is case-sensitive — inconsistent and unfriendly. Users typing the chain ticker as BTC / TAO is reasonable and supported elsewhere.
Steps to reproduce
alw swap now --from BTC --to TAO --amount 0.001
Expected behaviour
- Same as
alw swap quote --from BTC --to TAO --amount 0.001: chain IDs lowercased, command proceeds.
Actual behaviour
[red]Unknown source chain: BTC[/red] and exits.
Fix
Description
Severity: S3 (UX — gratuitous rejection of a reasonable invocation)
Location:
allways/cli/swap_commands/swap.py:603-608SUPPORTED_CHAINSkeys are lowercase (chains.py:40-43). Sister commands already lowercase before validating:quote.py:40-41—from_chain = from_chain.lower()pair.py:93,106—src_chain = src_chain.lower()Only
alw swap nowis case-sensitive — inconsistent and unfriendly. Users typing the chain ticker asBTC/TAOis reasonable and supported elsewhere.Steps to reproduce
alw swap now --from BTC --to TAO --amount 0.001Expected behaviour
alw swap quote --from BTC --to TAO --amount 0.001: chain IDs lowercased, command proceeds.Actual behaviour
[red]Unknown source chain: BTC[/red]and exits.Fix
One-liner before the validation block: