From 3afecc0c182b5e9802a60014dd4e793d585dcc61 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Mon, 23 Jun 2025 13:59:15 +0200 Subject: [PATCH] fix --- core/src/validation/user.ts | 1 - shared/src/index.ts | 2 +- shared/src/logic/decay.test.ts | 2 ++ shared/src/logic/index.ts | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/validation/user.ts b/core/src/validation/user.ts index 945b1c818..b188e5d54 100644 --- a/core/src/validation/user.ts +++ b/core/src/validation/user.ts @@ -15,7 +15,6 @@ export async function validateAlias(alias: string): Promise { logger.warn('invalid alias', alias, (err as ZodError).errors) throw new Error((err as ZodError).errors[0].message) } - console.log(err) throw err } diff --git a/shared/src/index.ts b/shared/src/index.ts index 936131a69..4c6acd552 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -1,3 +1,3 @@ export * from './schema' export * from './enum' -export * from './logic' +export * from './logic/decay' diff --git a/shared/src/logic/decay.test.ts b/shared/src/logic/decay.test.ts index f419982ac..1db94c4fe 100644 --- a/shared/src/logic/decay.test.ts +++ b/shared/src/logic/decay.test.ts @@ -10,6 +10,7 @@ describe('utils/decay', () => { // TODO: toString() was required, we could not compare two decimals expect(decayFormula(amount, seconds).toString()).toBe('0.999999978035040489732012') }) + it('has correct backward calculation', () => { const amount = new Decimal(1.0) const seconds = -1 @@ -25,6 +26,7 @@ describe('utils/decay', () => { expect(decayFormula(amount, seconds).toString()).toBe('1.0') }) }) + it('has base 0.99999997802044727', () => { const now = new Date() now.setSeconds(1) diff --git a/shared/src/logic/index.ts b/shared/src/logic/index.ts index 7056d5818..fca61a4b1 100644 --- a/shared/src/logic/index.ts +++ b/shared/src/logic/index.ts @@ -1,4 +1,3 @@ import { LOG4JS_BASE_CATEGORY_NAME } from '../const' export const LOG4JS_LOGIC_CATEGORY = `${LOG4JS_BASE_CATEGORY_NAME}.logic` -export { calculateDecay, Decay } from './decay' \ No newline at end of file