Skip to content

Commit

Permalink
cmd file too
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Aug 24, 2023
1 parent 956e595 commit db8dc1b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions x/ccv/provider/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit db8dc1b

Please sign in to comment.