Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Round total rewards to 6 decimal places #3396

Merged
merged 4 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -229,7 +229,9 @@ exports[`ActionModal should show the action modal on success 1`] = `
success="true"
>
<div>
Successful transaction

Successful transaction

</div>

<div>
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