diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 80746ff5d2..1240e242f0 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -31,6 +31,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdConsumerValidatorKeyAssignment()) cmd.AddCommand(CmdProviderValidatorKey()) cmd.AddCommand(CmdThrottleState()) + cmd.AddCommand(CmdThrottledConsumerPacketData()) cmd.AddCommand(CmdRegisteredConsumerRewardDenoms()) return cmd @@ -285,6 +286,42 @@ $ %s query provider throttle-state return cmd } +func CmdThrottledConsumerPacketData() *cobra.Command { + cmd := &cobra.Command{ + Use: "throttled-consumer-packet-data [chainid]", + Short: "Query pending VSCMatured and slash packet data for a consumer chainId", + Long: strings.TrimSpace( + fmt.Sprintf(`Returns the current pending VSCMatured and slash packet data instances for a consumer chainId. + Queue is ordered by ibc sequence number. +Example: +$ %s query provider throttled-consumer-packet-data foochain +`, + version.AppName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryThrottledConsumerPacketDataRequest{ChainId: args[0]} + res, err := queryClient.QueryThrottledConsumerPacketData(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + func CmdRegisteredConsumerRewardDenoms() *cobra.Command { cmd := &cobra.Command{ Use: "registered-consumer-reward-denoms",