From d5598932a7f06158b7a5e3aa031bbc94eaaae32c Mon Sep 17 00:00:00 2001 From: crypto-facs <84574577+crypto-facs@users.noreply.github.com> Date: Wed, 25 May 2022 16:02:01 +0200 Subject: [PATCH] imp(evm): add query params to CLI (#1091) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add query params to evm * update changelog Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- CHANGELOG.md | 1 + x/evm/client/cli/query.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c0bd07b..300e9b95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/x/evm/client/cli/query.go b/x/evm/client/cli/query.go index 0ea7cd33..edb802b3 100644 --- a/x/evm/client/cli/query.go +++ b/x/evm/client/cli/query.go @@ -23,6 +23,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetStorageCmd(), GetCodeCmd(), + GetParamsCmd(), ) return cmd } @@ -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 +}