Skip to content

Commit

Permalink
fix vote value
Browse files Browse the repository at this point in the history
fix vote value due to

incorrect voting power #2139
incorrect total shares #2141

Signed-off-by: Wiktor Tkaczyński <wiktor.tkaczynski@gmail.com>
  • Loading branch information
economicstudio authored and Sekhmet committed Jan 17, 2019
1 parent 73c4518 commit 87fdca0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/client/helpers/user.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { calculateVoteValue } from '../vendor/steemitHelpers';
import { calculateVoteValue, calculateVotingPower } from '../vendor/steemitHelpers';

export const getUserRank = vests => {
let rank = 'Plankton';
Expand Down Expand Up @@ -30,8 +30,9 @@ export const getUserRankKey = vests => {

export const getTotalShares = user =>
parseFloat(user.vesting_shares) +
parseFloat(user.received_vesting_shares) +
-parseFloat(user.delegated_vesting_shares);
parseFloat(user.received_vesting_shares) -
parseFloat(user.delegated_vesting_shares) -
parseFloat(user.vesting_withdraw_rate);

export const getHasDefaultSlider = user => getTotalShares(user) >= 10000000;

Expand All @@ -41,7 +42,7 @@ export const getVoteValue = (user, recentClaims, rewardBalance, rate, weight = 1
parseFloat(recentClaims),
parseFloat(rewardBalance),
rate,
user.voting_power,
calculateVotingPower(user) * 10000,
weight,
);

Expand Down

0 comments on commit 87fdca0

Please sign in to comment.