From 5d41bd7662d23d2a9fcc4a02a49797ce93b47630 Mon Sep 17 00:00:00 2001 From: Ahmed Hilali Date: Tue, 22 Feb 2022 16:19:51 +0800 Subject: [PATCH] Fix tests (#800) --- .../__tests__/api/poolpairs.test.ts | 23 +++++++++---------- .../model/dftx/pool.pair.e2e.ts | 4 ++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packages/whale-api-client/__tests__/api/poolpairs.test.ts b/packages/whale-api-client/__tests__/api/poolpairs.test.ts index e52fdcc40..2e6737187 100644 --- a/packages/whale-api-client/__tests__/api/poolpairs.test.ts +++ b/packages/whale-api-client/__tests__/api/poolpairs.test.ts @@ -554,7 +554,7 @@ describe('poolswap 24h', () => { }, volume: { d30: 11.028806333434215, - h24: 11.028806333434215 + h24: 10.146501826759481 } }) }) @@ -601,7 +601,7 @@ describe('poolswap aggregated', () => { amounts: { 2: '9.50000000' } }, block: expect.any(Object), - bucket: 1645660800, + bucket: expect.any(Number), id: expect.any(String), key: '10-86400' @@ -613,7 +613,7 @@ describe('poolswap aggregated', () => { } }, block: expect.any(Object), - bucket: 1645574400, + bucket: expect.any(Number), id: expect.any(String), key: '10-86400' }, @@ -622,37 +622,36 @@ describe('poolswap aggregated', () => { amounts: {} }, block: expect.any(Object), - bucket: 1645401600, + bucket: expect.any(Number), id: expect.any(String), key: '10-86400' } ]) - const hourAggregated: ApiPagedResponse = await client.poolpairs.listPoolSwapAggregates('10', PoolSwapAggregatedInterval.ONE_HOUR, 10) + const hourAggregated: ApiPagedResponse = await client.poolpairs.listPoolSwapAggregates('10', PoolSwapAggregatedInterval.ONE_HOUR, 3) expect([...hourAggregated]).toStrictEqual([ { - aggregated: { amounts: { 2: '9.50000000' } }, + aggregated: { amounts: { 2: '1.10000000' } }, block: expect.any(Object), - bucket: 1645660800, + bucket: expect.any(Number), id: expect.any(String), key: '10-3600' }, { - aggregated: { amounts: { 2: '29.00000000' } }, + aggregated: { amounts: { 2: '1.20000000' } }, block: expect.any(Object), - bucket: 1645574400, + bucket: expect.any(Number), id: expect.any(String), key: '10-3600' }, { - aggregated: { amounts: {} }, + aggregated: { amounts: { 2: '1.20000000' } }, block: expect.any(Object), - bucket: 1645444800, + bucket: expect.any(Number), id: expect.any(String), key: '10-3600' } - ]) }) }) diff --git a/src/module.indexer/model/dftx/pool.pair.e2e.ts b/src/module.indexer/model/dftx/pool.pair.e2e.ts index 07183ed1b..2ff7e3209 100644 --- a/src/module.indexer/model/dftx/pool.pair.e2e.ts +++ b/src/module.indexer/model/dftx/pool.pair.e2e.ts @@ -388,7 +388,7 @@ describe('poolswap 30d', () => { { id: expect.any(String), key: '2-86400', - bucket: 1645660800, + bucket: expect.any(Number), aggregated: { amounts: { 1: '23.90000000' @@ -399,7 +399,7 @@ describe('poolswap 30d', () => { { id: expect.any(String), key: '2-86400', - bucket: 1645574400, + bucket: expect.any(Number), aggregated: { amounts: { 1: '29.00000000'