Bugfix gov votes querier to use votes params (#7589)
* bugfix gov votes querier to use votes params * move partially used statement to the proper block Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
24e156bf62
commit
1542ecb18d
@ -337,9 +337,7 @@ func queryVotesOnProposalHandlerFn(clientCtx client.Context) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
params := types.NewQueryProposalVotesParams(proposalID, page, limit)
|
||||
|
||||
bz, err := clientCtx.LegacyAmino.MarshalJSON(params)
|
||||
bz, err := clientCtx.LegacyAmino.MarshalJSON(types.NewQueryProposalParams(proposalID))
|
||||
if rest.CheckBadRequestError(w, err) {
|
||||
return
|
||||
}
|
||||
@ -356,10 +354,17 @@ func queryVotesOnProposalHandlerFn(clientCtx client.Context) http.HandlerFunc {
|
||||
|
||||
// For inactive proposals we must query the txs directly to get the votes
|
||||
// as they're no longer in state.
|
||||
params := types.NewQueryProposalVotesParams(proposalID, page, limit)
|
||||
|
||||
propStatus := proposal.Status
|
||||
if !(propStatus == types.StatusVotingPeriod || propStatus == types.StatusDepositPeriod) {
|
||||
res, err = gcutils.QueryVotesByTxQuery(clientCtx, params)
|
||||
} else {
|
||||
bz, err = clientCtx.LegacyAmino.MarshalJSON(params)
|
||||
if rest.CheckBadRequestError(w, err) {
|
||||
return
|
||||
}
|
||||
|
||||
res, _, err = clientCtx.QueryWithData("custom/gov/votes", bz)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user