Fixing voting power calculation on steem-python
I have been using steem-python to power steem.rocks. The first bug report I get was the inconsistent voting power values. I have misinterpreted the issue and thought it was a node-lag issue.
Well, I was wrong. Today I saw a similar bug report on official steem-python package and @raserrano gave a good insight why that happens.
Turns out raw voting power data is based on the last vote time. In order to see the latest status, you need to add regenerated VP to that.
Quickly fixed it with the voting power regeneration calculation and opened a pull request to the steem-python package.
Did a quick test with a couple of accounts.
master branch
my proposed fix branch
works like a charm. Same with the steemd.
Also fixed the steem.rocks with the same implementation on commit de9cf458.
Thanks @jaff8, @raserrano and @yuxid for their contributions.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
[utopian-moderator]
Hey @emrebeyler I am @utopian-io. I have just super-voted you at 13% Power!
Suggestions https://utopian.io/rules
Achievements
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Look at that birthday pos. !BEER
View or trade
BEER
.Hey @emrebeyler, here is a little bit of
BEER
from @isnochys for you. Enjoy it!