Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introdue interchaintest add-contract --package-name <package name> options #90

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const (
YesFlag = "yes"
SuiteDirFlag = "suite-dir"
ContractNameFlag = "contract-name"
PackageFlag = "package"
MessagesOnlyFlag = "messages-only"

DebugFlag = "debug"
Expand Down
8 changes: 8 additions & 0 deletions cmd/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,12 @@
if err != nil {
return err
}
if packageName == "" {
packageName, err = cmd.Flags().GetString(PackageFlag)
if err != nil {
return err
}
}

err = interchaintest.AddContract(args[0], suiteDir, packageName)
if err != nil {
Expand All @@ -311,6 +317,8 @@

cmd.Flags().String(SuiteDirFlag, ".", "Path to the test suite directory. If not provided, the current working directory will be used.")
cmd.Flags().String(ContractNameFlag, "", "Name of the contract to be added to the test suite. If not provided, the contract name will be inferred from the schema file.")
cmd.Flags().MarkDeprecated(ContractNameFlag, "please use --package instead")

Check failure on line 320 in cmd/root_cmd.go

View workflow job for this annotation

GitHub Actions / golangci-lint

Error return value of `(*github.com/spf13/pflag.FlagSet).MarkDeprecated` is not checked (errcheck)
cmd.Flags().StringP(PackageFlag, "p", "", "Package name for the generated contract code. If not provided, the contract name will be inferred from the schema file.")
srdtrk marked this conversation as resolved.
Show resolved Hide resolved

return cmd
}
Loading