Add Slashing Query Params (#3117)

This commit is contained in:
Alexander Bezobchuk
2018-12-14 11:09:39 -08:00
committed by Jack Zampolin
parent 65beea4430
commit 110fd63e22
12 changed files with 242 additions and 10 deletions
+22
View File
@@ -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
}