Skip to content

Commit

Permalink
fix(client/keys): don't return when key not found in keys delete (cos…
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano authored Nov 27, 2023
1 parent 02b1b00 commit 7d5c2db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* (client/keys) [#18562](https://github.com/cosmos/cosmos-sdk/pull/18562) `keys delete` won't terminate when a key is not found
* (server) [#18537](https://github.com/cosmos/cosmos-sdk/pull/18537) Fix panic when defining minimum gas config as `100stake;100uatom`. Use a `,` delimiter instead of `;`. Fixes the server config getter to use the correct delimiter.
* (client/tx) [#18472](https://github.com/cosmos/cosmos-sdk/pull/18472) Utilizes the correct Pubkey when simulating a transaction.
* (baseapp) [#18486](https://github.com/cosmos/cosmos-sdk/pull/18486) Fixed FinalizeBlock calls not being passed to ABCIListeners
Expand Down
3 changes: 2 additions & 1 deletion client/keys/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ private keys stored in a ledger device cannot be deleted with the CLI.
for _, name := range args {
k, err := clientCtx.Keyring.Key(name)
if err != nil {
return err
cmd.PrintErrf("key %s not found\n", name)
continue
}

// confirm deletion, unless -y is passed
Expand Down
3 changes: 1 addition & 2 deletions client/keys/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ func Test_runDeleteCmd(t *testing.T) {
ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx)

err = cmd.ExecuteContext(ctx)
require.Error(t, err)
require.EqualError(t, err, "blah.info: key not found")
require.NoError(t, err)

// User confirmation missing
cmd.SetArgs([]string{
Expand Down

0 comments on commit 7d5c2db

Please sign in to comment.