Skip to content

Commit

Permalink
add initiad q move params
Browse files Browse the repository at this point in the history
  • Loading branch information
Vritra4 committed Nov 3, 2023
1 parent 6207370 commit 8898758
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions x/move/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func GetQueryCmd() *cobra.Command {
GetCmdTableEntry(),
GetCmdTableEntries(),
GetCmdQueryEntryFunction(),
GetCmdQueryParams(),
)
return queryCmd
}
Expand Down Expand Up @@ -391,3 +392,39 @@ $ %s query move execute \
flags.AddQueryFlagsToCmd(cmd)
return cmd
}

// GetCmdQueryParams implements the params query command.
func GetCmdQueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Args: cobra.NoArgs,
Short: "Query the current move parameters information",
Long: strings.TrimSpace(
fmt.Sprintf(`Query values set as staking parameters.
Example:
$ %s query move params
`,
version.AppName,
),
),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientQueryContext(cmd)
if err != nil {
return err
}
queryClient := types.NewQueryClient(clientCtx)

res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{})
if err != nil {
return err
}

return clientCtx.PrintProto(&res.Params)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

0 comments on commit 8898758

Please sign in to comment.