From 72c1098972196854647b39e5140efc1caaa1bf22 Mon Sep 17 00:00:00 2001 From: Jongwhan Lee <51560997+leejw51crypto@users.noreply.github.com> Date: Fri, 12 Nov 2021 17:16:46 +0900 Subject: [PATCH] fix: cli-config for `keys` command (#725) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Problem: config/client.toml keyring-backend not working correctly (fix #724) refactoring fix lint refactoring Apply suggestions from code review add changelog * changelog Co-authored-by: Federico Kunze Küllmer --- CHANGELOG.md | 1 + client/keys.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb08d46..3ee1593a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (app,cli) [tharsis#725](https://github.com/tharsis/ethermint/pull/725) Fix cli-config for `keys` command. * (rpc) [tharsis#727](https://github.com/tharsis/ethermint/pull/727) Decode raw transaction using RLP. * (rpc) [tharsis#661](https://github.com/tharsis/ethermint/pull/661) Fix OOM bug when creating too many filters using JSON-RPC. * (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix `nil` pointer panic in `ApplyNativeMessage`. diff --git a/client/keys.go b/client/keys.go index 0569637b..06bc345c 100644 --- a/client/keys.go +++ b/client/keys.go @@ -93,14 +93,12 @@ func runAddCmd(cmd *cobra.Command, args []string) error { dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun) if dryRun { kr, err = keyring.New(sdk.KeyringServiceName(), keyring.BackendMemory, clientCtx.KeyringDir, buf, hd.EthSecp256k1Option()) - } else { - backend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) - kr, err = keyring.New(sdk.KeyringServiceName(), backend, clientCtx.KeyringDir, buf, hd.EthSecp256k1Option()) + clientCtx = clientCtx.WithKeyring(kr) } if err != nil { return err } - return clientkeys.RunAddCmd(clientCtx.WithKeyring(kr), cmd, args, buf) + return clientkeys.RunAddCmd(clientCtx, cmd, args, buf) }