From 4f004ae80361187c7c56182e384e2bb5aa0d074a Mon Sep 17 00:00:00 2001 From: mariopino Date: Fri, 10 Jan 2020 10:33:20 +0100 Subject: [PATCH 1/4] Round total rewards to 6 decimal places --- src/ActionModal/components/ModalWithdrawRewards.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ActionModal/components/ModalWithdrawRewards.vue b/src/ActionModal/components/ModalWithdrawRewards.vue index fc033e335e..415977ecec 100644 --- a/src/ActionModal/components/ModalWithdrawRewards.vue +++ b/src/ActionModal/components/ModalWithdrawRewards.vue @@ -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 { From 06a893d0fe7a84e0d8fd02647aae2faad9dafff5 Mon Sep 17 00:00:00 2001 From: mariopino Date: Fri, 10 Jan 2020 10:40:35 +0100 Subject: [PATCH 2/4] changelog --- changes/mario_3376-fix-rewards-decimals | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/mario_3376-fix-rewards-decimals diff --git a/changes/mario_3376-fix-rewards-decimals b/changes/mario_3376-fix-rewards-decimals new file mode 100644 index 0000000000..a9130f56a5 --- /dev/null +++ b/changes/mario_3376-fix-rewards-decimals @@ -0,0 +1 @@ +[Fixed] [#3376](https://github.com/cosmos/lunie/issues/3376) Round total rewards to 6 decimal places @mariopino \ No newline at end of file From 37bc371dcb2b6ec3fe09faf300e7f47e5cecc05f Mon Sep 17 00:00:00 2001 From: mariopino Date: Fri, 10 Jan 2020 10:47:04 +0100 Subject: [PATCH 3/4] Update snaps --- .../components/__snapshots__/ActionModal.spec.js.snap | 4 +++- .../__snapshots__/ModalWithdrawRewards.spec.js.snap | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap index f3de3fc2b1..0c1303fc37 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ActionModal.spec.js.snap @@ -229,7 +229,9 @@ exports[`ActionModal should show the action modal on success 1`] = ` success="true" >
- Successful transaction + + Successful transaction +
diff --git a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalWithdrawRewards.spec.js.snap b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalWithdrawRewards.spec.js.snap index f0012ba02b..5099c5b65e 100644 --- a/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalWithdrawRewards.spec.js.snap +++ b/tests/unit/specs/components/ActionModal/components/__snapshots__/ModalWithdrawRewards.spec.js.snap @@ -39,7 +39,7 @@ exports[`ModalWithdrawRewards should show the withdraw rewards modal 1`] = ` disabled="disabled" id="amount" type="number" - value="0" + value="0.000000" /> From 3d771eed4a5b5c638509c5670561dd6ffed3d847 Mon Sep 17 00:00:00 2001 From: mariopino Date: Fri, 10 Jan 2020 10:51:49 +0100 Subject: [PATCH 4/4] Remove async from describe in ActionManager test --- .../specs/components/ActionModal/utils/ActionManager.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/specs/components/ActionModal/utils/ActionManager.spec.js b/tests/unit/specs/components/ActionModal/utils/ActionManager.spec.js index eb4bbf6e3e..525d607cc7 100644 --- a/tests/unit/specs/components/ActionModal/utils/ActionManager.spec.js +++ b/tests/unit/specs/components/ActionModal/utils/ActionManager.spec.js @@ -171,7 +171,7 @@ describe("ActionManager", () => { } }) - describe("simulating and sending", async () => { + describe("simulating and sending", () => { beforeEach(async () => { const context = { url: "blah",