Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
imp(evm): add query params to CLI (#1091)
Browse files Browse the repository at this point in the history
* add query params to evm

* update changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
  • Loading branch information
crypto-facs and fedekunze authored May 25, 2022
1 parent c441771 commit d559893
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### API Breaking

* (evm) [tharsis#1051](https://github.com/tharsis/ethermint/pull/1051) Context block height fix on TraceTx. Removes `tx_index` on `QueryTraceTxRequest` proto type.
* (evm) [tharsis#1091](https://github.com/tharsis/ethermint/pull/1091) Add query params command on EVM Module

### Improvements

Expand Down
29 changes: 29 additions & 0 deletions x/evm/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func GetQueryCmd() *cobra.Command {
cmd.AddCommand(
GetStorageCmd(),
GetCodeCmd(),
GetParamsCmd(),
)
return cmd
}
Expand Down Expand Up @@ -103,3 +104,31 @@ func GetCodeCmd() *cobra.Command {
flags.AddQueryFlagsToCmd(cmd)
return cmd
}

// GetParamsCmd queries the fee market params
func GetParamsCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "params",
Short: "Get the evm params",
Long: "Get the evm parameter values.",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, _ []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 d559893

Please sign in to comment.