Skip to content

Commit

Permalink
Merge pull request #413 from protofire/staked-voting-mkr
Browse files Browse the repository at this point in the history
  • Loading branch information
leolower authored May 27, 2020
2 parents a4958c3 + 0f69090 commit 5035c34
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/Home/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const getStakedMkrData = (data: any, time: string) => {
return -1
}

if (a.type === 'LOCK' || (a.type === 'FREE' && b.type)) {
if (a.type === 'LOCK' || a.type === 'FREE') {
return -1
}

Expand Down Expand Up @@ -144,10 +144,6 @@ function calculateVotingMkr(
const stake = voters[sender] || new BigNumber(0)

if (type === 'LOCK') {
const tS = totalStaked.plus(wad)
const tV = stake.isZero() ? totalVoting : totalVoting.plus(wad)
const vs = { ...voters, [sender]: !stake.isZero() ? stake.plus(wad) : new BigNumber(0) }

return {
totalStaked: totalStaked.plus(wad),
totalVoting: stake.isZero() ? totalVoting : totalVoting.plus(wad),
Expand Down Expand Up @@ -176,7 +172,7 @@ function calculateVotingMkr(
}

return {
totalStaked: totalStaked,
totalStaked,
totalVoting: newTotalVoting,
voters: { ...voters, [sender]: yays.length ? new BigNumber(wad) : new BigNumber(0) },
}
Expand Down

0 comments on commit 5035c34

Please sign in to comment.