Skip to content

SuiNS name resolution is inconsistent across CLI commands (history rejects names balance/call accept) #3

Description

@Kingvic300

Description

SuiNS name resolution is applied inconsistently across CLI commands. Balance and Call resolve .sui names before use, but History does not:

// cli/src/cli/handlers.rs — Balance resolves the name first
let address = adapter.resolve_name(&address).await?;
// cli/src/cli/handlers.rs:605-615 — History passes the raw string straight through
ChainCommand::History { address, limit } => {
    ...
    let result = adapter.get_history(&address, limit).await?;

get_history for Sui calls validate_sui_address(address) (cli/src/chains/sui.rs:206), which rejects anything non-hex.

Verified

txio sui balance alice.sui resolves the name successfully (via resolve_name), while txio sui history alice.sui fails with Invalid Sui address: must contain only hexadecimal characters — the exact same name that works for one subcommand fails for another with no indication why. Call's SuiAdapter::call_rpc also runs resolve_names_in_value over its params (chains/sui.rs:148-151), confirming History is the odd one out rather than the intended behavior.

Suggested fix

Route History's address argument through the same resolve_name step used by Balance before validation, for parity across commands.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions