diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d95306b37..54f23cae2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [\#1301](https://github.com/Finschia/finschia-sdk/pull/1301) Use bytes instead of string comparison in delete validator queue (backport cosmos/cosmos-sdk#12303) * (x/gov) [\#1304](https://github.com/Finschia/finschia-sdk/pull/1304) fetch a failed proposal tally from proposal.FinalTallyResult in the gprc query * (x/staking) [\#1306](https://github.com/Finschia/finschia-sdk/pull/1306) add validation for potential slashing evasion during re-delegation +* (client/keys) [#1312](https://github.com/Finschia/finschia-sdk/pull/1312) ignore error when key not found in `keys delete` ### Removed diff --git a/client/keys/delete.go b/client/keys/delete.go index b9e182a4c6..532e14edd0 100644 --- a/client/keys/delete.go +++ b/client/keys/delete.go @@ -37,7 +37,8 @@ private keys stored in a ledger device cannot be deleted with the CLI. for _, name := range args { info, 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 diff --git a/client/keys/delete_test.go b/client/keys/delete_test.go index afb1c0fb0f..2a4bf397fd 100644 --- a/client/keys/delete_test.go +++ b/client/keys/delete_test.go @@ -51,8 +51,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{