fix: list keys output for empty keys (#15876)

This commit is contained in:
Mantas Vidutis
2023-04-19 19:43:26 +00:00
committed by GitHub
parent 5eb9a45d47
commit 5948b38c13
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -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
+2 -1
View File
@@ -1,6 +1,7 @@
package keys
import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
@@ -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
}