Merge PR #4932: Fix gov query vote cmd
This commit is contained in:
parent
3a4f1fc4d4
commit
1f04826b07
@ -83,6 +83,8 @@ that error is that the account doesn't exist.
|
||||
* (keys) Fix ledger custom coin type support bug
|
||||
* (simulation) [\#4912](https://github.com/cosmos/cosmos-sdk/issues/4912) Fix SimApp ModuleAccountAddrs to properly return black listed addresses for bank keeper initialization
|
||||
* (cli) [\#4919](https://github.com/cosmos/cosmos-sdk/pull/4919) Don't crash cli if user doesn't answer y/n confirmation request
|
||||
* (cli) [\#4927](https://github.com/cosmos/cosmos-sdk/issues/4927) Fix the `q gov vote`
|
||||
command to handle empty (pruned) votes correctly.
|
||||
|
||||
## [v0.36.0] - 2019-08-13
|
||||
|
||||
|
||||
@ -215,21 +215,24 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk
|
||||
}
|
||||
|
||||
var vote types.Vote
|
||||
if err := cdc.UnmarshalJSON(res, &vote); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// XXX: Allow the decoding to potentially fail as the vote may have been
|
||||
// pruned from state. If so, decoding will fail and so we need to check the
|
||||
// Empty() case. Consider updating Vote JSON decoding to not fail when empty.
|
||||
_ = cdc.UnmarshalJSON(res, &vote)
|
||||
|
||||
if vote.Empty() {
|
||||
res, err = gcutils.QueryVoteByTxQuery(cliCtx, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := cdc.UnmarshalJSON(res, &vote); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return cliCtx.PrintOutput(vote) //nolint:errcheck
|
||||
return cliCtx.PrintOutput(vote)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user