[RPC] Fix API "GetVotes" to return all votes
@@ -832,11 +832,9 @@ func (rpc *AergoRPCService) GetVotes(ctx context.Context, in *types.VoteParams)
}
func (rpc *AergoRPCService) GetAccountVotes(ctx context.Context, in *types.AccountAddress) (*types.AccountVoteInfo, error) {
- ids := []string{
- types.VoteBP[2:],
- types.VoteNumBP[2:],
- types.VoteNamePrice[2:],
- types.VoteMinStaking[2:],
+ ids := []string{}
+ for _, v := range types.AllVotes {
+ ids = append(ids, v[2:])
}
result, err := rpc.hub.RequestFuture(message.ChainSvc,
&message.GetVote{Addr: in.Value, Ids: ids}, defaultActorTimeout, "rpc.(*AergoRPCService).GetAccountVote").Result()
