fix: list keys output for empty keys (#15876)
This commit is contained in:
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user