You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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/...
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: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:
How to reproduce
Compare the value in the extension with those on steemd/steemworld/...
Here is the corresponding part in the code:
utopian-moderator/js/utopian.js
Line 391 in 2c9d77f
@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
The text was updated successfully, but these errors were encountered: