Skip to content

Commit

Permalink
fix: list keys output for empty keys (#15876)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvid authored Apr 19, 2023
1 parent 5eb9a45 commit 5948b38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/capability) [#15030](https://github.com/cosmos/cosmos-sdk/pull/15030) Prevent `x/capability` from consuming `GasMeter` gas during `InitMemStore`
* (types/coin) [#14739](https://github.com/cosmos/cosmos-sdk/pull/14739) Deprecate the method `Coin.IsEqual` in favour of `Coin.Equal`. The difference between the two methods is that the first one results in a panic when denoms are not equal. This panic lead to unexpected behavior
* (x/crypto) [#15258](https://github.com/cosmos/cosmos-sdk/pull/15258) Write keyhash file with permissions 0600 instead of 0555.
* (client/keys) [15867](https://github.com/cosmos/cosmos-sdk/pull/15876) Fix the output of the client keys query when there are no keys

### Deprecated

Expand Down
3 changes: 2 additions & 1 deletion client/keys/list.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package keys

import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"

"github.com/cosmos/cosmos-sdk/client"
Expand Down Expand Up @@ -33,7 +34,7 @@ func runListCmd(cmd *cobra.Command, _ []string) error {
return err
}

if len(records) == 0 {
if len(records) == 0 && clientCtx.OutputFormat == flags.OutputFormatText {
cmd.Println("No records were found in keyring")
return nil
}
Expand Down

0 comments on commit 5948b38

Please sign in to comment.