Fixing voting power calculation on steem-python

in #utopian-io6 years ago

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

Sort:  

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

  • Your contribution is less informative than others in this category.

Achievements

  • I am a bot...I love developers... <3
  • You have less than 500 followers. Just gave you a gift ;)
  • Seems like you contribute quite often. AMAZING!
    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



Hey @emrebeyler, here is a little bit of BEER from @isnochys for you. Enjoy it!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.033
BTC 63016.70
ETH 3028.58
USDT 1.00
SBD 3.75