From fed04b1e0c8599830eaef96c93d3ac73eaaea79e Mon Sep 17 00:00:00 2001 From: daniel Date: Sat, 23 Nov 2024 07:46:24 -0500 Subject: [PATCH] TS lint --- package.json | 7 ++++-- .../anchor/tests/deposit-liquidity.ts | 24 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 38f2bf014..13d6e22d3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "prepare": "husky" }, "lint-staged": { - "*": ["biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true"] + "*": [ + "biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true" + ] }, "keywords": [], "author": "Solana Foundation", @@ -31,5 +33,6 @@ "anchor-bankrun": "^0.4.0", "chai": "^5.1.1", "solana-bankrun": "^0.3.0" - } + }, + "packageManager": "pnpm@9.14.2+sha512.6e2baf77d06b9362294152c851c4f278ede37ab1eba3a55fda317a4a17b209f4dbb973fb250a77abc463a341fcb1f17f17cfa24091c4eb319cda0d9b84278387" } diff --git a/tokens/token-swap/anchor/tests/deposit-liquidity.ts b/tokens/token-swap/anchor/tests/deposit-liquidity.ts index 166cdf05b..fe90fa74b 100644 --- a/tokens/token-swap/anchor/tests/deposit-liquidity.ts +++ b/tokens/token-swap/anchor/tests/deposit-liquidity.ts @@ -99,8 +99,8 @@ describe('Deposit liquidity', () => { it('Deposit amounts a > b, then a < b', async () => { - var depositAmountA = new BN(9 * 10 ** 6) - var depositAmountB = new BN(4 * 10 ** 6) + const depositAmountA = new BN(9 * 10 ** 6) + const depositAmountB = new BN(4 * 10 ** 6) await program.methods .depositLiquidity(depositAmountA, depositAmountB) .accounts({ @@ -130,10 +130,10 @@ describe('Deposit liquidity', () => { // Expected behavior is that depositAmountA gets increased to // (27 * 10 ** 6) * (9/4) = 60.75 * 10 ** 6 // to maintain the ratio established in the above deposit - depositAmountA = new BN(18 * 10 ** 6) - depositAmountB = new BN(27 * 10 ** 6) + const depositAmountA2 = new BN(18 * 10 ** 6) + const depositAmountB2 = new BN(27 * 10 ** 6) await program.methods - .depositLiquidity(depositAmountA, depositAmountB) + .depositLiquidity(depositAmountA2, depositAmountB2) .accounts({ pool: values.poolKey, poolAuthority: values.poolAuthority, @@ -159,12 +159,12 @@ describe('Deposit liquidity', () => { .sub(new BN(60.75 * 10 ** 6)).toString()); const depositTokenAccountB2 = await connection.getTokenAccountBalance(values.holderAccountB); expect(depositTokenAccountB2.value.amount).to.equal(new BN (depositTokenAccountB.value.amount) - .sub(depositAmountB).toString()); + .sub(depositAmountB2).toString()); }); it('Deposit amounts a < b, then a > b', async () => { - var depositAmountA = new BN(4 * 10 ** 6) - var depositAmountB = new BN(9 * 10 ** 6) + const depositAmountA = new BN(4 * 10 ** 6) + const depositAmountB = new BN(9 * 10 ** 6) await program.methods .depositLiquidity(depositAmountA, depositAmountB) .accounts({ @@ -194,10 +194,10 @@ describe('Deposit liquidity', () => { // Expected behavior is that depositAmountB gets increased to // (27 * 10 ** 6) * (9/4) = 60.75 * 10 ** 6 // to maintain the ratio established in the above deposit - depositAmountA = new BN(27 * 10 ** 6) - depositAmountB = new BN(18 * 10 ** 6) + const depositAmountA2 = new BN(27 * 10 ** 6) + const depositAmountB2 = new BN(18 * 10 ** 6) await program.methods - .depositLiquidity(depositAmountA, depositAmountB) + .depositLiquidity(depositAmountA2, depositAmountB2) .accounts({ pool: values.poolKey, poolAuthority: values.poolAuthority, @@ -220,7 +220,7 @@ describe('Deposit liquidity', () => { .toString()); const depositTokenAccountA2 = await connection.getTokenAccountBalance(values.holderAccountA); expect(depositTokenAccountA2.value.amount).to.equal(new BN (depositTokenAccountA.value.amount) - .sub(depositAmountA).toString()); + .sub(depositAmountA2).toString()); const depositTokenAccountB2 = await connection.getTokenAccountBalance(values.holderAccountB); expect(depositTokenAccountB2.value.amount).to.equal(new BN (depositTokenAccountB.value.amount) .sub(new BN(60.75 * 10 ** 6)).toString());