The voting power returned from Python library is inconsistent with steemdsteemCreated with Sketch.

in #utopian-io9 years ago

I have found a potential bug in Steem Python library. The voting power returned from Python library is inconsistent from the VP returned from steemd.com. For example, I ran the Python script to get my VP:

#!/usr/bin/env python

from steem.account import Account

account = Account("yuxid")
print("VP: %s" % account.voting_power())

At the time of testing, it returns:

VP: 43.48

However, it shows 59.39% in steemd

image.png



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Vote power from the block chain is based on the last time a vote was performed, so steemd calculates the time that has passed since that vote and 'regenerates' the VP.

 var vpRegenerated = secondsDiff * 10000 / 86400 / 5;

didn't know that. I had a bug report for steem.rocks about the inconsistency of VP. Now, it's clear. :)

Thank you.

Sure, not sure if its the same issue or something more python related

yes, it's the same issue. I will open a pull request with a proposed fix. :)

thanks, Steem Python should do the same.

Brother I vote and comment on every post but you do not vote and comment on my post too. Please follow me..https://steemit.com/@mdjony

Thank you for the contribution. It has been approved.

[utopian-moderator]

Hey @yuxid I am @utopian-io. I have just super-voted you at 2% Power!

Suggestions https://utopian.io/rules

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

Achievements

  • I am a bot...I need someone spotting my bugs!
  • You have less than 500 followers. Just gave you a gift ;)
    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

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.088
BTC 59323.46
ETH 1593.23
USDT 1.00
SBD 0.38