Add Slashing Query Params (#3117)
This commit is contained in:
committed by
Jack Zampolin
parent
65beea4430
commit
110fd63e22
@@ -57,3 +57,25 @@ func GetCmdQuerySigningInfo(storeName string, cdc *codec.Codec) *cobra.Command {
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
// GetCmdQueryParams implements a command to fetch slashing parameters.
|
||||
func GetCmdQueryParams(cdc *codec.Codec) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "params",
|
||||
Short: "Query the current slashing parameters",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
cliCtx := context.NewCLIContext().WithCodec(cdc)
|
||||
route := fmt.Sprintf("custom/%s/parameters", slashing.QuerierRoute)
|
||||
|
||||
res, err := cliCtx.QueryWithData(route, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Println(string(res))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user