Skip to content

fix(fxconfig/cli): enforce --submit and --wait flag dependencies#220

Open
ARYANPATEL-BIT wants to merge 1 commit into
hyperledger:mainfrom
ARYANPATEL-BIT:fix/252-flag-validation
Open

fix(fxconfig/cli): enforce --submit and --wait flag dependencies#220
ARYANPATEL-BIT wants to merge 1 commit into
hyperledger:mainfrom
ARYANPATEL-BIT:fix/252-flag-validation

Conversation

@ARYANPATEL-BIT

@ARYANPATEL-BIT ARYANPATEL-BIT commented May 1, 2026

Copy link
Copy Markdown

Description

Background & Motivation

Currently, in the fxconfig namespace create and update CLI commands, the --submit flag documentation states that it "requires --endorse". However, this constraint is not enforced programmatically.

As a result:

  • Using --submit without --endorse simply returns early and saves an unsigned transaction, completely ignoring the user's intent to submit.
  • Using --endorse without --submit succeeds in endorsing the transaction but offers no console output or guidance to the user on what to do next.

What was changed

  • Flag Validation: Added a Validate() method to namespaceDeployFlags in flags.go to enforce the following dependencies:
    • --submit strictly requires --endorse.
    • --wait strictly requires --submit.
  • Command Updates: Updated namespace_create.go and namespace_update.go to execute namespace.Validate() early in the RunE flow.
  • UX Improvements: Added a console print statement that triggers when a user specifies --endorse without --submit. It informs the user that the transaction was endorsed successfully and instructs them to use fxconfig tx submit later.
  • Documentation: Updated the CLI --help strings (Long documentation) to clarify exactly how these lifecycle flags interact.

Testing

  • Added comprehensive unit tests in flags_test.go covering all valid and invalid flag permutations.
  • Ran existing test suites to ensure no regressions in current functionality.

FIXES: #219

Signed-off-by: ARYANPATEL-BIT <aryan.patel7291@gmail.com>
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.

bug(fxconfig/cli): --submit and --wait flags silently ignored without --endorse

1 participant