Skip to content

Commit e3fce67

Browse files
mergify[bot]mvidjulienrbrt
authored
fix: list keys output for empty keys (backport #15876) (#15894)
Co-authored-by: Mantas Vidutis <mantas.a.vidutis@gmail.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 967efc6 commit e3fce67

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4747

4848
* (baseapp) [#15789](https://github.com/cosmos/cosmos-sdk/pull/15789) Ensure `PrepareProposal` and `ProcessProposal` respect `InitialHeight` set by CometBFT when set to a value greater than 1.
4949
* (types) [#15433](https://github.com/cosmos/cosmos-sdk/pull/15433) Allow disabling of account address caches (for printing bech32 account addresses).
50+
* (client/keys) [#15876](https://github.com/cosmos/cosmos-sdk/pull/15876) Fix the JSON output `<appd> keys list --output json` when there are no keys.
5051

5152
## [v0.47.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.1) - 2023-03-23
5253

client/keys/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func runListCmd(cmd *cobra.Command, _ []string) error {
3333
return err
3434
}
3535

36-
if len(records) == 0 {
36+
if len(records) == 0 && clientCtx.OutputFormat == OutputFormatJSON {
3737
cmd.Println("No records were found in keyring")
3838
return nil
3939
}

0 commit comments

Comments
 (0)