From 87159cb51fb90d59b9cea832efaadf83693bf083 Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:29:37 +0530 Subject: [PATCH] add emergency group ugov cli query (#2245) --- 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{