Skip to content

Commit

Permalink
[Core] turn on tick transition test
Browse files Browse the repository at this point in the history
  • Loading branch information
0xVolosnikov committed Jun 13, 2023
1 parent 5fc5ebe commit 6b410af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/test/AlgebraPool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1602,14 +1602,15 @@ describe('AlgebraPool', () => {
await expect(sqrtTickMath.getSqrtRatioAtTick(-887273)).to.be.revertedWith('T');
})

xit('tick transition cannot run twice if zero for one swap ends at fractional price just below tick', async () => {
it('tick transition cannot run twice if zero for one swap ends at fractional price just below tick', async () => {
pool = await createPool(FeeAmount.MEDIUM)
const sqrtTickMath = (await (await ethers.getContractFactory('TickMathTest')).deploy()) as TickMathTest
const PriceMovementMath = (await (await ethers.getContractFactory('PriceMovementMathTest')).deploy()) as PriceMovementMathTest
const p0 = (await sqrtTickMath.getSqrtRatioAtTick(-24081)).add(1)
// initialize at a price of ~0.3 token1/token0
// meaning if you swap in 2 token0, you should end up getting 0 token1
await pool.initialize(p0)
await pool.setTickSpacing(1);
expect(await pool.liquidity(), 'current pool liquidity is 1').to.eq(0)
expect((await pool.globalState()).tick, 'pool tick is -24081').to.eq(-24081)

Expand Down

0 comments on commit 6b410af

Please sign in to comment.