-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit tests for decreaseLiquidity.ts #545
base: main
Are you sure you want to change the base?
Conversation
|
||
for (const poolName of poolTypes.keys()) { | ||
it(`Should close the position for ${poolName}`, async () => { | ||
await testClosePositionInstructions(poolName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TE Position?
await assert.rejects( | ||
decreaseLiquidityInstructions( | ||
rpc, | ||
positions.entries().next().value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Maybe hard-code the key here so it is clear which position it is getting
const position = await setupPosition(poolAddress, { | ||
tickLower: -100, | ||
tickUpper: 100, | ||
liquidity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One test to close a postion without liquidity?
await sendTransaction(instructions); | ||
|
||
const positionAfter = await fetchMaybePosition(rpc, positionAddress[0]); | ||
assert.strictEqual(positionAfter.exists, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also check if fees/rewards are harvested correctly?
Title
Added unit tests for decreaseLiquidity.ts
Details
setupPosition
andsetupTEPosition
to support increased liquiditydecreaseLiquidity.ts
decreaseLiquidity.test.ts
closePosition.test.ts