Skip to content

Commit

Permalink
Add provider cli query
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Oct 28, 2022
1 parent 7b02a94 commit 48532e0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions x/ccv/provider/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func NewQueryCmd() *cobra.Command {
cmd.AddCommand(CmdConsumerChains())
cmd.AddCommand(CmdConsumerStartProposals())
cmd.AddCommand(CmdConsumerStopProposals())
cmd.AddCommand(CmdConsumerValidatorKeyMapping())

return cmd
}
Expand Down Expand Up @@ -143,3 +144,31 @@ func CmdConsumerStopProposals() *cobra.Command {

return cmd
}

func CmdConsumerValidatorKeyMapping() *cobra.Command {
cmd := &cobra.Command{
Use: "list-chain-validator-key-mapping",
Short: "TODO:",
Long: `TODO:`,
Args: cobra.ExactArgs(0),
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.QueryConsumerChainValidatorKeyMappingRequest{}
res, err := queryClient.QueryConsumerChainValidatorKeyMapping(cmd.Context(), req)
if err != nil {
return err
}

return clientCtx.PrintProto(res)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

0 comments on commit 48532e0

Please sign in to comment.