Skip to content

Commit

Permalink
reconcile: query param CLI command
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite authored and red-0ne committed Feb 21, 2024
1 parent 19b6b44 commit 62feb1d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions x/supplier/module/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (am AppModule) GetQueryCmd() *cobra.Command {
RunE: client.ValidateCmd,
}

cmd.AddCommand(CmdQueryParams())
cmd.AddCommand(CmdListSupplier())
cmd.AddCommand(CmdShowSupplier())
// this line is used by starport scaffolding # 1
Expand Down
36 changes: 36 additions & 0 deletions x/supplier/module/query_params.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package supplier

import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"

"github.com/pokt-network/poktroll/x/supplier/types"
)

func CmdQueryParams() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "shows the parameters of the module",
Args: cobra.NoArgs,
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)
},
}

flags.AddQueryFlagsToCmd(cmd)

return cmd
}

0 comments on commit 62feb1d

Please sign in to comment.