From 997e7f091b38429bdc386f94150a8373d435b88b Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Thu, 14 Sep 2023 22:03:01 +0530 Subject: [PATCH] add emergency group ugov cli query --- x/ugov/client/cli/query.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/x/ugov/client/cli/query.go b/x/ugov/client/cli/query.go index 65edb43f68..43dec209b6 100644 --- a/x/ugov/client/cli/query.go +++ b/x/ugov/client/cli/query.go @@ -24,11 +24,35 @@ func GetQueryCmd() *cobra.Command { QueryMinGasPrice(), QueryInflationParams(), QueryInflationCyleEnd(), + QueryEmergencyGroup(), ) return cmd } +// QueryEmergencyGroup creates the Msg/QueryEmergencyGroup CLI. +func QueryEmergencyGroup() *cobra.Command { + cmd := &cobra.Command{ + Use: "emergency-group", + Args: cobra.NoArgs, + Short: "Query the emergency group address.", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := ugov.NewQueryClient(clientCtx) + resp, err := queryClient.EmergencyGroup(cmd.Context(), &ugov.QueryEmergencyGroup{}) + return cli.PrintOrErr(resp, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // QueryMinGasPrice creates the Msg/QueryMinGasPrice CLI. func QueryMinGasPrice() *cobra.Command { cmd := &cobra.Command{