Skip to content

Commit

Permalink
comment out different test
Browse files Browse the repository at this point in the history
  • Loading branch information
zielvna committed Jul 9, 2024
1 parent af39071 commit 202afec
Showing 1 changed file with 59 additions and 53 deletions.
112 changes: 59 additions & 53 deletions sdk/tests/get-all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,56 +298,7 @@ describe('get-all', async () => {
}
})

// it('get all positions with positions per page', async function () {
// this.timeout(30000)

// await invariant.addFeeTier(account, feeTier)
// await invariant.createPool(
// account,
// newPoolKey(token0Address, token1Address, feeTier),
// SQRT_PRICE_DENOMINATOR
// )
// for (let i = 0; i < 50; i++) {
// await invariant.createPosition(
// account,
// poolKey,
// -BigInt((i + 1) * 10),
// BigInt((i + 1) * 10),
// 1000000n,
// SQRT_PRICE_DENOMINATOR,
// 0n
// )
// }

// const positionsPerPage = 10n
// const pages = await invariant.getAllPositions(
// account.address,
// undefined,
// undefined,
// positionsPerPage
// )
// assert.equal(pages.length, 5)
// assert.equal(pages.map(page => page.entries).flat(1).length, 50)

// for (const { index, entries } of pages) {
// for (const [positionIndex, [position, pool]] of entries.entries()) {
// const expectedPosition = await invariant.getPosition(
// account.address,
// BigInt(index * Number(positionsPerPage) + positionIndex)
// )
// const expectedPool = await invariant.getPool(
// expectedPosition.poolKey.tokenX,
// expectedPosition.poolKey.tokenY,
// expectedPosition.poolKey.feeTier
// )

// assert.deepEqual(position, expectedPosition)
// assert.deepEqual(pool, expectedPool)
// }
// }
// })

it('get all positions with positions per page and skip pages', async function () {
it('get all positions with positions per page', async function () {
this.timeout(30000)

await invariant.addFeeTier(account, feeTier)
Expand All @@ -372,11 +323,11 @@ describe('get-all', async () => {
const pages = await invariant.getAllPositions(
account.address,
undefined,
[1, 3],
undefined,
positionsPerPage
)
assert.equal(pages.length, 3)
assert.equal(pages.map(page => page.entries).flat(1).length, 30)
assert.equal(pages.length, 5)
assert.equal(pages.map(page => page.entries).flat(1).length, 50)

for (const { index, entries } of pages) {
for (const [positionIndex, [position, pool]] of entries.entries()) {
Expand All @@ -395,4 +346,59 @@ describe('get-all', async () => {
}
}
})

it('test', async function () {
this.timeout(30000)

assert.equal(true, true)
})

// it('get all positions with positions per page and skip pages', async function () {
// this.timeout(30000)

// await invariant.addFeeTier(account, feeTier)
// await invariant.createPool(
// account,
// newPoolKey(token0Address, token1Address, feeTier),
// SQRT_PRICE_DENOMINATOR
// )
// for (let i = 0; i < 50; i++) {
// await invariant.createPosition(
// account,
// poolKey,
// -BigInt((i + 1) * 10),
// BigInt((i + 1) * 10),
// 1000000n,
// SQRT_PRICE_DENOMINATOR,
// 0n
// )
// }

// const positionsPerPage = 10n
// const pages = await invariant.getAllPositions(
// account.address,
// undefined,
// [1, 3],
// positionsPerPage
// )
// assert.equal(pages.length, 3)
// assert.equal(pages.map(page => page.entries).flat(1).length, 30)

// for (const { index, entries } of pages) {
// for (const [positionIndex, [position, pool]] of entries.entries()) {
// const expectedPosition = await invariant.getPosition(
// account.address,
// BigInt(index * Number(positionsPerPage) + positionIndex)
// )
// const expectedPool = await invariant.getPool(
// expectedPosition.poolKey.tokenX,
// expectedPosition.poolKey.tokenY,
// expectedPosition.poolKey.feeTier
// )

// assert.deepEqual(position, expectedPosition)
// assert.deepEqual(pool, expectedPool)
// }
// }
// })
})

0 comments on commit 202afec

Please sign in to comment.