diff --git a/CHANGELOG.md b/CHANGELOG.md index 01cd83118e2a..d1ca41f204a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking Changes +* [\#10950](https://github.com/cosmos/cosmos-sdk/pull/10950) Add `envPrefix` parameter to `cmd.Execute`. * (x/mint) [\#10441](https://github.com/cosmos/cosmos-sdk/pull/10441) The `NewAppModule` function now accepts an inflation calculation function as an argument. * [\#10295](https://github.com/cosmos/cosmos-sdk/pull/10295) Remove store type aliases from /types * [\#9695](https://github.com/cosmos/cosmos-sdk/pull/9695) Migrate keys from `Info` -> `Record` diff --git a/server/cmd/execute.go b/server/cmd/execute.go index d2170fcba3d6..4f715d3cc3de 100644 --- a/server/cmd/execute.go +++ b/server/cmd/execute.go @@ -17,7 +17,7 @@ import ( // server context object with the appropriate server and client objects injected // into the underlying stdlib Context. It also handles adding core CLI flags, // specifically the logging flags. It returns an error upon execution failure. -func Execute(rootCmd *cobra.Command, defaultHome string) error { +func Execute(rootCmd *cobra.Command, envPrefix string, defaultHome string) error { // Create and set a client.Context on the command's Context. During the pre-run // of the root command, a default initialized client.Context is provided to // seed child command execution with values such as AccountRetriver, Keyring, @@ -32,6 +32,6 @@ func Execute(rootCmd *cobra.Command, defaultHome string) error { rootCmd.PersistentFlags().String(flags.FlagLogLevel, zerolog.InfoLevel.String(), "The logging level (trace|debug|info|warn|error|fatal|panic)") rootCmd.PersistentFlags().String(flags.FlagLogFormat, tmlog.LogFormatPlain, "The logging format (json|plain)") - executor := tmcli.PrepareBaseCmd(rootCmd, "", defaultHome) + executor := tmcli.PrepareBaseCmd(rootCmd, envPrefix, defaultHome) return executor.ExecuteContext(ctx) } diff --git a/simapp/simd/cmd/cmd_test.go b/simapp/simd/cmd/cmd_test.go index 1a9183d33e08..0e2a291e9c74 100644 --- a/simapp/simd/cmd/cmd_test.go +++ b/simapp/simd/cmd/cmd_test.go @@ -20,5 +20,5 @@ func TestInitCmd(t *testing.T) { fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists }) - require.NoError(t, svrcmd.Execute(rootCmd, simapp.DefaultNodeHome)) + require.NoError(t, svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome)) } diff --git a/simapp/simd/main.go b/simapp/simd/main.go index 3e744360f468..6ac86d18d3f3 100644 --- a/simapp/simd/main.go +++ b/simapp/simd/main.go @@ -12,7 +12,7 @@ import ( func main() { rootCmd, _ := cmd.NewRootCmd() - if err := svrcmd.Execute(rootCmd, simapp.DefaultNodeHome); err != nil { + if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil { switch e := err.(type) { case server.ErrorCode: os.Exit(e.Code)