Skip to content

Commit

Permalink
fix: swap tests (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomiir authored May 10, 2024
1 parent 697e4d7 commit 18f7a2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/core/tests/controllers/SwapController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/tests/utils/SwapCalculationUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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', () => {
Expand All @@ -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', () => {
Expand Down

0 comments on commit 18f7a2f

Please sign in to comment.