From 18f7a2f82e54e3168e386f732e8a67961b6e72cb Mon Sep 17 00:00:00 2001 From: tomiir Date: Fri, 10 May 2024 15:19:49 +0200 Subject: [PATCH] fix: swap tests (#2241) --- packages/core/tests/controllers/SwapController.test.ts | 4 ++-- packages/core/tests/utils/SwapCalculationUtil.test.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/tests/controllers/SwapController.test.ts b/packages/core/tests/controllers/SwapController.test.ts index c84f1904ec..4dcc5f6dbd 100644 --- a/packages/core/tests/controllers/SwapController.test.ts +++ b/packages/core/tests/controllers/SwapController.test.ts @@ -72,8 +72,8 @@ describe('SwapController', () => { await SwapController.swapTokens() expect(SwapController.state.gasPriceInUSD).toEqual(0.0010485260814) - expect(SwapController.state.priceImpact).toEqual(0.898544263592072) - expect(SwapController.state.maxSlippage).toEqual(0.00019274639331006023) + expect(SwapController.state.priceImpact).toEqual(1.0003077978972612) + expect(SwapController.state.maxSlippage).toEqual(0.00019255219039488635) }) it('should reset values as expected', () => { diff --git a/packages/core/tests/utils/SwapCalculationUtil.test.ts b/packages/core/tests/utils/SwapCalculationUtil.test.ts index ab0f0f91d9..80ca32d900 100644 --- a/packages/core/tests/utils/SwapCalculationUtil.test.ts +++ b/packages/core/tests/utils/SwapCalculationUtil.test.ts @@ -58,7 +58,7 @@ describe('SwapCalculationUtil', () => { toTokenAmount, toTokenPriceInUSD: toToken.price }) - expect(priceImpact).equal(7.646854717783376) + expect(priceImpact).equal(7.755424414926879) }) it('should get to token amount with same decimals including provider fee as expected', () => { @@ -69,7 +69,7 @@ describe('SwapCalculationUtil', () => { toToken, toTokenPrice: toToken.price }) - expect(toTokenAmount).equal('6.725738471695571914') + expect(toTokenAmount).equal('6.718961909003687207') }) it('should get to token amount with different decimals including provider fee as expected', () => { @@ -82,7 +82,7 @@ describe('SwapCalculationUtil', () => { toToken: newToToken, toTokenPrice: newToToken.price }) - expect(toTokenAmount).equal('0.694063') + expect(toTokenAmount).equal('0.693364') }) it('should calculate the maximum slippage as expected', () => {