Skip to content

Commit

Permalink
updated position manager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EdNoepel committed Dec 29, 2023
1 parent e55fdb9 commit f1671db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tests/position-manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('LP Token and PositionManager', () => {
await submitAndVerifyTransaction(response);

lp = await getLP(signerLender, tokenId, bucketIndex);
expect(lp.toString()).toBe(amount.toString());
expect(lp).toEqual(toWad('199.990867579908675800'));

// check in position (should be true)
inPosition = await lpToken.isIndexInPosition(bucketIndex, tokenId);
Expand All @@ -122,7 +122,7 @@ describe('LP Token and PositionManager', () => {

// add, mint, and memorialize liquidity
await addQuoteTokensByIndexes(signerLender, pool, [fromIndex], [amount]);
expect(await fromBucket.lpBalance(signerLender.address)).toEqual(toWad(100));
expect(await fromBucket.lpBalance(signerLender.address)).toEqual(toWad('99.9958904109589041'));
expect(await toBucket.lpBalance(signerLender.address)).toEqual(toWad(0));
let tx = await pool.mintLPToken(signerLender);
const receipt = await submitAndVerifyTransaction(tx);
Expand All @@ -139,7 +139,7 @@ describe('LP Token and PositionManager', () => {
// move liquidity to another bucket
expect(await lpToken.isIndexInPosition(fromIndex, tokenId)).toBe(true);
expect(await lpToken.isIndexInPosition(toIndex, tokenId)).toBe(false);
tx = await lpToken.moveLiquidity(signerLender, pool.contract, fromIndex, toIndex, 33, true);
tx = await lpToken.moveLiquidity(signerLender, pool.contract, fromIndex, toIndex, 33);
await submitAndVerifyTransaction(tx);
expect(await lpToken.isIndexInPosition(fromIndex, tokenId)).toBe(false);
expect(await lpToken.isIndexInPosition(toIndex, tokenId)).toBe(true);
Expand All @@ -148,7 +148,7 @@ describe('LP Token and PositionManager', () => {
tx = await lpToken.redeemPositions(signerLender, pool.contract, [toIndex]);
await submitAndVerifyTransaction(tx);
expect(await fromBucket.lpBalance(signerLender.address)).toEqual(toWad(0));
expect(await toBucket.lpBalance(signerLender.address)).toEqual(toWad(100));
expect(await toBucket.lpBalance(signerLender.address)).toEqual(toWad('99.991780990805029067'));
});

it('increaseLPAllowance should throw exception if indexes and amounts not the same length', async () => {
Expand Down

0 comments on commit f1671db

Please sign in to comment.