From e8e5abc11af6879bedb708b47c8e912606983439 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Sat, 25 Jan 2025 13:34:54 -0800 Subject: [PATCH] patch: fix type error by extending AddLiquidity class --- src/entities/addLiquidity/index.ts | 2 +- src/entities/addLiquidityBoosted/index.ts | 7 ++----- .../removeLiquidityBoosted.integration.test.ts | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/entities/addLiquidity/index.ts b/src/entities/addLiquidity/index.ts index f4b9d01f..27336be9 100644 --- a/src/entities/addLiquidity/index.ts +++ b/src/entities/addLiquidity/index.ts @@ -17,7 +17,7 @@ import { Hex } from 'viem'; export class AddLiquidity implements AddLiquidityBase { constructor(public config?: AddLiquidityConfig) {} - private readonly inputValidator: InputValidator = new InputValidator(); + protected readonly inputValidator: InputValidator = new InputValidator(); query( input: AddLiquidityInput, diff --git a/src/entities/addLiquidityBoosted/index.ts b/src/entities/addLiquidityBoosted/index.ts index bc91de7f..4031767e 100644 --- a/src/entities/addLiquidityBoosted/index.ts +++ b/src/entities/addLiquidityBoosted/index.ts @@ -32,18 +32,15 @@ import { balancerRouterAbi, } from '@/abi'; -import { InputValidator } from '../inputValidator/inputValidator'; - import { Hex } from '@/types'; import { AddLiquidityBoostedBuildCallInput, AddLiquidityBoostedInput, AddLiquidityBoostedQueryOutput, } from './types'; +import { AddLiquidity } from '../addLiquidity'; -export class AddLiquidityBoostedV3 { - private readonly inputValidator: InputValidator = new InputValidator(); - +export class AddLiquidityBoostedV3 extends AddLiquidity { async query( input: AddLiquidityBoostedInput, poolState: PoolStateWithUnderlyings, diff --git a/test/v3/removeLiquidityBoosted/removeLiquidityBoosted.integration.test.ts b/test/v3/removeLiquidityBoosted/removeLiquidityBoosted.integration.test.ts index 59f52c7b..08fb33f4 100644 --- a/test/v3/removeLiquidityBoosted/removeLiquidityBoosted.integration.test.ts +++ b/test/v3/removeLiquidityBoosted/removeLiquidityBoosted.integration.test.ts @@ -102,7 +102,6 @@ describe('remove liquidity test', () => { }); snapshot = await client.snapshot(); - // Approve the Vault to spend Tokens on the users behalf via Permit2 for (const token of boostedPool_USDC_USDT.tokens) { await approveSpenderOnPermit2( client, @@ -126,7 +125,7 @@ describe('remove liquidity test', () => { await doAddLiquidity({ client, - addLiquidity: new AddLiquidityBoostedV3(), // TODO: debug linter type complaint + addLiquidity: new AddLiquidityBoostedV3(), addLiquidityInput, slippage: Slippage.fromPercentage('1'), poolState: boostedPool_USDC_USDT,