From 3881d783c8976cf6bc7bc4b5a45a23b68e48d8f6 Mon Sep 17 00:00:00 2001 From: Bobo Date: Tue, 9 Jul 2024 11:54:22 +0200 Subject: [PATCH 1/2] Circulation supply calculation fix --- src/services/StatsService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/StatsService.ts b/src/services/StatsService.ts index 4217c82..dae4d46 100644 --- a/src/services/StatsService.ts +++ b/src/services/StatsService.ts @@ -70,7 +70,7 @@ export class StatsService implements IStatsService { private getTotalBalanceToExclude(balances: AccountData[]): BN { const sum = balances .map((balance) => { - return balance.free.add(balance.miscFrozen ?? balance.frozen); + return balance.free; }) .reduce((partialSum, b) => partialSum.add(b), new BN(0)); From 1f36788cc048214e8ca9c5464395c4a915d61b22 Mon Sep 17 00:00:00 2001 From: Bobo Date: Tue, 9 Jul 2024 12:21:17 +0200 Subject: [PATCH 2/2] Test fix --- tests/services/StatsService.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/services/StatsService.test.ts b/tests/services/StatsService.test.ts index e5264f4..3ea87dc 100644 --- a/tests/services/StatsService.test.ts +++ b/tests/services/StatsService.test.ts @@ -18,7 +18,7 @@ describe('getTokenStats', () => { const result = await service.getTokenStats('astar'); - expect(result.circulatingSupply).toBe(83); + expect(result.circulatingSupply).toBe(85); }); it('returns valid total supply', async () => {