Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetVoteStats API not returning a qrl.VoteStatsResp object #1692

Closed
som-dev opened this issue Mar 23, 2020 · 5 comments
Closed

GetVoteStats API not returning a qrl.VoteStatsResp object #1692

som-dev opened this issue Mar 23, 2020 · 5 comments

Comments

@som-dev
Copy link
Contributor

som-dev commented Mar 23, 2020

Running qrl node 0.2.0 off dev branch and testnet. I cannot successfully call GetVoteStats() with what I believe to be a properly populated GetVoteStatsReq object.

The error in my local node suggests the response is getting assigned an instance of the QRL VoteStats object instead of a pbdata VoteStatsResp object:

2020-03-22 22:15:30,070|0.2.0+44.g78c2815b.dirty python|synced |ThreadPoolExecutor-0_0| ERROR : Traceback (most recent call last):
File "/home/sysop/dev/theqrl/QRL/src/qrl/services/grpcHelper.py", line 25, in wrap_f
return f(caller_self, request, context)
File "/home/sysop/dev/theqrl/QRL/src/qrl/services/PublicAPIService.py", line 502, in GetVoteStats
return self.qrlnode.get_vote_stats(request.multi_sig_spend_tx_hash)
File "/home/sysop/dev/theqrl/QRL/src/qrl/core/qrlnode.py", line 669, in get_vote_stats
return qrl_pb2.GetVoteStatsResp(vote_stats=vote_stats)
TypeError: Parameter to MergeFrom() must be instance of same class: expected qrl.VoteStats got VoteStats.

@cyyber
Copy link
Member

cyyber commented Mar 23, 2020

Fixed in PR #1693 . It will be available on next release.

@cyyber cyyber closed this as completed Mar 23, 2020
@som-dev
Copy link
Contributor Author

som-dev commented Mar 23, 2020

I pulled dev and tried the query again but I still see an error on my local server, although with a different reason (note the traceback has the new vote_stats=vote_stats.pbdata):

2020-03-23 10:17:01,296|2.0.0+2.gb90d2190.dirty python|synced |ThreadPoolExecutor-0_0| ERROR : Traceback (most recent call last):
File "/home/sysop/dev/theqrl/QRL/src/qrl/services/grpcHelper.py", line 25, in wrap_f
return f(caller_self, request, context)
File "/home/sysop/dev/theqrl/QRL/src/qrl/services/PublicAPIService.py", line 502, in GetVoteStats
return self.qrlnode.get_vote_stats(request.multi_sig_spend_tx_hash)
File "/home/sysop/dev/theqrl/QRL/src/qrl/core/qrlnode.py", line 669, in get_vote_stats
return qrl_pb2.GetVoteStatsResp(vote_stats=vote_stats.pbdata)
TypeError: Parameter to MergeFrom() must be instance of same class: expected qrl.VoteStats got method.

@cyyber
Copy link
Member

cyyber commented Mar 24, 2020

Thanks for reporting. PR #1694 should have fixed the above issue.

@som-dev
Copy link
Contributor Author

som-dev commented Mar 24, 2020

pulled latest dev and it works, thanks!

@cyyber
Copy link
Member

cyyber commented Mar 24, 2020

Thanks for reporting and testing the fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants