Skip to content

Commit 9fc6407

Browse files
committed
add consumer genesis time command to provider CLI
1 parent b92e321 commit 9fc6407

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

x/ccv/provider/client/cli/query.go

+28
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ func NewQueryCmd() *cobra.Command {
4141
cmd.AddCommand(CmdBlocksUntilNextEpoch())
4242
cmd.AddCommand(CmdConsumerIdFromClientId())
4343
cmd.AddCommand(CmdConsumerChain())
44+
cmd.AddCommand(CmdConsumerGenesisTime())
4445
return cmd
4546
}
4647

@@ -584,3 +585,30 @@ func CmdConsumerChain() *cobra.Command {
584585

585586
return cmd
586587
}
588+
589+
func CmdConsumerGenesisTime() *cobra.Command {
590+
cmd := &cobra.Command{
591+
Use: "consumer-genesis-time [consumer-id]",
592+
Short: "Query the genesis time of the consumer chain associated with the consumer id",
593+
Args: cobra.ExactArgs(1),
594+
RunE: func(cmd *cobra.Command, args []string) error {
595+
clientCtx, err := client.GetClientQueryContext(cmd)
596+
if err != nil {
597+
return err
598+
}
599+
queryClient := types.NewQueryClient(clientCtx)
600+
601+
req := &types.QueryConsumerGenesisTimeRequest{ConsumerId: args[0]}
602+
res, err := queryClient.QueryConsumerGenesisTime(cmd.Context(), req)
603+
if err != nil {
604+
return err
605+
}
606+
607+
return clientCtx.PrintProto(res)
608+
},
609+
}
610+
611+
flags.AddQueryFlagsToCmd(cmd)
612+
613+
return cmd
614+
}

0 commit comments

Comments
 (0)