Skip to content

Commit

Permalink
Round total rewards to 6 decimal places (#3396)
Browse files Browse the repository at this point in the history
* Round total rewards to 6 decimal places

* changelog

* Update snaps

* Remove async from describe in ActionManager test
  • Loading branch information
mariopino committed Jan 13, 2020
1 parent 04d7c6e commit 748a10b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changes/mario_3376-fix-rewards-decimals
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Fixed] [#3376](https://github.com/cosmos/lunie/issues/3376) Round total rewards to 6 decimal places @mariopino
4 changes: 3 additions & 1 deletion src/ActionModal/components/ModalWithdrawRewards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export default {
}
},
totalRewards() {
return this.rewards.reduce((sum, { amount }) => sum + Number(amount), 0)
return this.rewards
.reduce((sum, { amount }) => sum + Number(amount), 0)
.toFixed(6)
},
notifyMessage() {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ exports[`ModalWithdrawRewards should show the withdraw rewards modal 1`] = `
disabled="disabled"
id="amount"
type="number"
value="0"
value="0.000000"
/>
</tmformgroup-stub>
</actionmodal-stub>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ describe("ActionManager", () => {
}
})

describe("simulating and sending", async () => {
describe("simulating and sending", () => {
beforeEach(async () => {
const context = {
url: "blah",
Expand Down

0 comments on commit 748a10b

Please sign in to comment.