Skip to content

Commit

Permalink
Fix proposal deposit (#261)
Browse files Browse the repository at this point in the history
* Remove denom handling from getDeposit()

* Revert undesired change

* delete package-lock.json
  • Loading branch information
mariopino authored and faboweb committed Jan 10, 2020
1 parent df4c3d5 commit b00d820
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/reducers/cosmosV0-reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ const expectedRewardsPerToken = (validator, commission, annualProvision) => {
return annualDelegatorRewardsPerToken.div(1000000)
}

// reduce deposits to one number and filter by required denom
function getDeposit(proposal, bondDenom) {
// reduce deposits to one number
function getDeposit(proposal) {
return atoms(
proposal.total_deposit.reduce(
(sum, cur) => sum.plus(cur.denom === bondDenom ? cur.amount : 0),
(sum, cur) => sum.plus(cur.amount),
BigNumber(0)
)
)
Expand Down Expand Up @@ -163,7 +163,7 @@ function proposalReducer(
statusBeginTime: proposalBeginTime(proposal),
statusEndTime: proposalEndTime(proposal),
tally: tallyReducer(proposal, tally, totalBondedTokens),
deposit: getDeposit(proposal, 'uatom'), // TODO use denom lookup
deposit: getDeposit(proposal),
proposer: proposer.proposer
}
}
Expand Down

0 comments on commit b00d820

Please sign in to comment.