Skip to content

Commit

Permalink
Fix calculating uncommittedCurrentRoundReward
Browse files Browse the repository at this point in the history
  • Loading branch information
shingonu committed Apr 30, 2020
1 parent 67a73ff commit 07b79f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const initialState = {

// rank
accountsDepositedWithPower: [],

// not yet committed
uncommittedCurrendRoundReward: _WTON('0'),
};

Expand Down Expand Up @@ -289,12 +291,16 @@ export default new Vuex.Store({
function getUnstakedRate () {
return _WTON(_TON(tonBalanceOfDepositManager, TON_UNIT).toBigNumber().toString(), WTON_UNIT)
.add(_WTON(wtonBalanceOfDepositManager, WTON_UNIT))
.div(_TON(tonTotalSupply, TON_UNIT).toBigNumber().toString(), WTON_UNIT);
.div(_WTON(_TON(tonTotalSupply, TON_UNIT).toBigNumber().toString()), WTON_UNIT);
}

const numBlocks = calcNumSeigBlocks();
const unstakedRate = getUnstakedRate();
const uncommittedCurrendRoundReward = unstakedRate.times(numBlocks).times(seigPerBlock).times(0.8).times(0.5);
const uncommittedCurrendRoundReward = unstakedRate
.times(numBlocks)
.times(_WTON(seigPerBlock, WTON_UNIT))
.times(0.8)
.times(0.5);
context.commit('SET_UNCOMMITTED_CURRENT_ROUND_REWARD', uncommittedCurrendRoundReward);
},
async checkPendingTransactions (context) {
Expand Down

1 comment on commit 07b79f9

@vercel
Copy link

@vercel vercel bot commented on 07b79f9 Apr 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.