fix(client,server): consistently set env prefix between client/server (#18345)

This commit is contained in:
Julien Robert
2023-11-03 09:58:26 +00:00
committed by GitHub
parent c664daaf55
commit 9e91c7b419
7 changed files with 21 additions and 22 deletions
+3 -10
View File
@@ -147,20 +147,13 @@ API services are enabled via the 'grpc-only' flag. In this mode, CometBFT is
bypassed and can be used when legacy queries are needed after an on-chain upgrade
is performed. Note, when enabled, gRPC will also be automatically enabled.
`,
PreRunE: func(cmd *cobra.Command, _ []string) error {
RunE: func(cmd *cobra.Command, _ []string) error {
serverCtx := GetServerContextFromCmd(cmd)
// Bind flags to the Context's Viper so the app construction can set
// options accordingly.
if err := serverCtx.Viper.BindPFlags(cmd.Flags()); err != nil {
_, err := GetPruningOptionsFromFlags(serverCtx.Viper)
if err != nil {
return err
}
_, err := GetPruningOptionsFromFlags(serverCtx.Viper)
return err
},
RunE: func(cmd *cobra.Command, _ []string) error {
serverCtx := GetServerContextFromCmd(cmd)
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err