Skip to content

fix(apps/transfer): require all transfer CLI arguments - #9153

Open
zakazaka95 wants to merge 1 commit into
lfdt-ibc:mainfrom
zakazaka95:fix/transfer-cli-required-arguments
Open

zakazaka95 wants to merge 1 commit into
lfdt-ibc:mainfrom
zakazaka95:fix/transfer-cli-required-arguments

Conversation

@zakazaka95

@zakazaka95 zakazaka95 commented Nov 6, 2026 •

Copy link
Copy Markdown

Description

NewTransferTxCmd accepts two or three positional arguments, then RunE unconditionally indexes receiver and coin at args[2] and args[3]. A normal incomplete CLI invocation panics.

Require exactly four positional arguments through Cobra before running transaction logic. Execute the real Cobra command with two and three arguments and verify usage errors without panic. Validate the complete four-argument form remains accepted.

Validation

  • The regression fails on unchanged production code; go test -mod=readonly ./modules/apps/transfer/client/cli passes with this patch.
  • CI-pinned golangci-lint v2.11.3 with Go1.26.10: zero issues in the owning package.
  • make format, LEDGER_ENABLED=false make build, make lint-docs and make build-docs pass.
  • Full pinned lint across all modules passed in the Linux validation below.

Checklist

  • One logical change, diff kept as small as practical
  • Commits signed off for the DCO (git commit -s), matching the commit author identity
  • AI assistance disclosed with an Assisted-By trailer in the commit body
  • Commit messages follow Conventional Commits
  • Tests cover expected and error paths
  • CI is green
  • SPDX license header on new files (or no new files)
  • Pull request title follows Conventional Commits
  • No architecture, public interface or spec change requiring an ADR

AI assistance: OpenAI Codex was used for the implementation, tests and this description.

Linux validation

Fork validation run passed for exact source commit 156e5a164c335e9e5eff80c986ae5ca18e7fd2ca. Checks: Build and lint PR 9153; Documentation PR 9153; Unit tests PR 9153.

Reject incomplete transfer commands before accessing the receiver or coin.
Exercise both formerly panicking invocations and retain the complete form.

Assisted-By: OpenAI Codex
Signed-off-by: Zaksans <yyzarijayy@gmail.com>
@zakazaka95
zakazaka95 marked this pull request as ready for review November 6, 2026 23:24
@zakazaka95
zakazaka95 requested a review from a team as a code owner November 6, 2026 23:24
@greptile-apps

greptile-apps Bot commented Nov 6, 2026

Copy link
Copy Markdown

This PR does not match any of the 1 configured review trigger rule.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant