Expected behavior
The utopian-moderator extension should show the current utopian-io voting power
Actual behavior

The extension shows the utopian-io voting power at the time of the last utopian vote. The voting_power field in the steem account information only stores the VP at the time of the last vote, not the current value:
>>> from steem.account import Account
>>> a = Account("utopian-io")
>>> a['voting_power']
6680
In order to get the current VP, one has to calculate the voting power regeneration since the last vote. Here's the python-equivalent to get the current voting power:
def get_voting_power(account):
"""get current voting power. The 'last_vote_time' value in the account
data only contains the VP at the time of the last vote.
"""
last_vote_time = parse(account['last_vote_time'])
diff = (dt.datetime.utcnow() - last_vote_time).total_seconds()
regenerated_vp = diff * 10000 / 86400 / 5
total_vp = (account['voting_power'] + regenerated_vp) / 100.0
if total_vp > 100:
total_vp = 100.0
return total_vp
How to reproduce
Compare the value in the extension with those on steemd/steemworld/...
Here is the corresponding part in the code:
https://github.com/DoctorLai/utopian-moderator/blob/2c9d77f73b344191cf850d28a419413961cc8fd1/js/utopian.js#L391
@justyy, steemtools seems to be affected as well:
https://github.com/DoctorLai/SteemTools/blob/24283592c488f23b0df4218982ecb801343d2496/js/steemtools.js#L36
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
Thanks! good catch.. You can submit the PR to fix or wait till my next version. :)
You can contact us on Discord.
[utopian-moderator]
Hey @stmdev I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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