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 busyorg#2139
incorrect total shares busyorg#2141
  • Loading branch information
economicstudio committed Dec 30, 2018
1 parent 346bef7 commit 0f5a69c
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 0f5a69c

Please sign in to comment.