From cffadab4af671e62640e7bcb53d58a9dc4e415f9 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Mon, 18 Oct 2021 21:50:42 +0200 Subject: [PATCH] fix: Decay Rounded to Ceil --- backend/src/graphql/resolver/TransactionResolver.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index 644a213e6..e0eb179c4 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -24,7 +24,7 @@ import { UserTransaction as dbUserTransaction } from '../../typeorm/entity/UserT import { Transaction as dbTransaction } from '../../typeorm/entity/Transaction' import { apiPost } from '../../apis/HttpRequest' -import { roundFloorFrom4 } from '../../util/round' +import { roundFloorFrom4, roundCeilFrom4 } from '../../util/round' import { calculateDecay, calculateDecayWithInterval } from '../../util/decay' import { TransactionTypeId } from '../enum/TransactionTypeId' import { TransactionType } from '../enum/TransactionType' @@ -150,7 +150,7 @@ async function calculateAndAddDecayTransactions( const decayTransaction = new Transaction() decayTransaction.type = 'decay' - decayTransaction.balance = roundFloorFrom4(balance) + decayTransaction.balance = roundCeilFrom4(balance) decayTransaction.decayDuration = decay.decayDuration decayTransaction.decayStart = decay.decayStart decayTransaction.decayEnd = decay.decayEnd