diff --git a/test/lib/utils/initPoolHelper.ts b/test/lib/utils/initPoolHelper.ts index 284f8a87..ff59a835 100644 --- a/test/lib/utils/initPoolHelper.ts +++ b/test/lib/utils/initPoolHelper.ts @@ -4,20 +4,16 @@ import { TxOutput, sendTransactionGetBalances } from './helper'; import { InitPoolTxInput } from './types'; function sdkInitPool({ - initPool, - initPoolInput: addLiquidityInput, + initPoolInput, poolState, }: { - initPool: InitPool; initPoolInput: InitPoolInput; poolState: PoolState; }): { initPoolBuildOutput: InitPoolBuildOutput; } { - const initPoolBuildOutput = initPool.buildCall( - addLiquidityInput, - poolState, - ); + const initPool = new InitPool(); + const initPoolBuildOutput = initPool.buildCall(initPoolInput, poolState); return { initPoolBuildOutput, @@ -25,10 +21,9 @@ function sdkInitPool({ } export async function doInitPool(txInput: InitPoolTxInput) { - const { initPool, poolState, initPoolInput, testAddress, client } = txInput; + const { poolState, initPoolInput, testAddress, client } = txInput; const { initPoolBuildOutput } = sdkInitPool({ - initPool, initPoolInput, poolState, }); diff --git a/test/lib/utils/types.ts b/test/lib/utils/types.ts index 4a7f8230..d924b136 100644 --- a/test/lib/utils/types.ts +++ b/test/lib/utils/types.ts @@ -6,7 +6,6 @@ import { Address, ChainId, CreatePoolInput, - InitPool, InitPoolInput, NestedPoolState, PoolState, @@ -33,7 +32,6 @@ export type InitPoolTxInput = Omit< 'addLiquidity' | 'addLiquidityInput' > & { initPoolInput: InitPoolInput; - initPool: InitPool; }; export type RemoveLiquidityTxInputBase = { diff --git a/test/v2/initPool/composableStable.integration.test.ts b/test/v2/initPool/composableStable.integration.test.ts index ae2484a5..e9e59993 100644 --- a/test/v2/initPool/composableStable.integration.test.ts +++ b/test/v2/initPool/composableStable.integration.test.ts @@ -18,7 +18,6 @@ import { Slippage, CreatePoolV2ComposableStableInput, InitPoolDataProvider, - InitPool, InitPoolInput, } from 'src'; import { ANVIL_NETWORKS, startFork } from '../../anvil/anvil-global-setup'; @@ -99,7 +98,6 @@ describe('Composable Stable Pool - Init Pool tests', async () => { initPoolTxInput = { client, - initPool: new InitPool(), testAddress: signerAddress, initPoolInput: {} as InitPoolInput, slippage: Slippage.fromPercentage('0.01'), diff --git a/test/v2/initPool/weighted.integration.test.ts b/test/v2/initPool/weighted.integration.test.ts index 2a537538..166f1b8b 100644 --- a/test/v2/initPool/weighted.integration.test.ts +++ b/test/v2/initPool/weighted.integration.test.ts @@ -18,7 +18,6 @@ import { Slippage, CreatePoolV2WeightedInput, InitPoolDataProvider, - InitPool, InitPoolInput, } from 'src'; import { ANVIL_NETWORKS, startFork } from '../../anvil/anvil-global-setup'; @@ -96,7 +95,6 @@ describe('Add Liquidity Init - Weighted Pool', async () => { initPoolTxInput = { client, - initPool: new InitPool(), testAddress: signerAddress, initPoolInput: {} as InitPoolInput, slippage: Slippage.fromPercentage('0.01'), diff --git a/test/v3/createPool/stable/stable.integration.test.ts b/test/v3/createPool/stable/stable.integration.test.ts index 122ec8c8..48868f59 100644 --- a/test/v3/createPool/stable/stable.integration.test.ts +++ b/test/v3/createPool/stable/stable.integration.test.ts @@ -18,7 +18,6 @@ import { TokenType, CreatePoolV3StableInput, InitPoolDataProvider, - InitPool, Slippage, } from 'src'; import { ANVIL_NETWORKS, startFork } from '../../../anvil/anvil-global-setup'; @@ -30,13 +29,12 @@ import { vaultExtensionAbi_V3 } from 'src/abi/'; import { doInitPool, assertInitPool } from 'test/lib/utils/initPoolHelper'; import { forkSetup } from 'test/lib/utils/helper'; -describe('Create Stable Pool tests', () => { +describe('create stable pool test', () => { + const protocolVersion = 3; const chainId = ChainId.SEPOLIA; const poolType = PoolType.Stable; - const protocolVersion = 3; - const DAI = TOKENS[chainId].DAI; - const BAL = TOKENS[chainId].BAL; - const INIT_AMOUNT = '100'; + const scUSD = TOKENS[chainId].scUSD; + const scDAI = TOKENS[chainId].scDAI; let rpcUrl: string; let client: PublicWalletClient & TestActions; @@ -59,18 +57,18 @@ describe('Create Stable Pool tests', () => { poolType, chainId, protocolVersion, - name: 'DAI USDC Stable Pool', - symbol: 'DAI-USDC', + name: 'scUSD scDAI Stable Pool', + symbol: 'scUSD-scDAI', amplificationParameter: 420n, tokens: [ { - address: DAI.address, + address: scUSD.address, rateProvider: zeroAddress, tokenType: TokenType.STANDARD, paysYieldFees: false, }, { - address: BAL.address, + address: scDAI.address, rateProvider: zeroAddress, tokenType: TokenType.STANDARD, paysYieldFees: false, @@ -116,8 +114,8 @@ describe('Create Stable Pool tests', () => { client, testAddress, poolState.tokens.map((t) => t.address), - [BAL.slot!, DAI.slot!], - poolState.tokens.map((t) => parseUnits(INIT_AMOUNT, t.decimals)), + [scDAI.slot!, scUSD.slot!], + poolState.tokens.map((t) => parseUnits('100', t.decimals)), undefined, protocolVersion, ); @@ -125,17 +123,17 @@ describe('Create Stable Pool tests', () => { const initPoolInput = { amountsIn: [ { - address: createPoolInput.tokens[1].address, - rawAmount: parseUnits(INIT_AMOUNT, BAL.decimals), - decimals: BAL.decimals, + address: createPoolInput.tokens[0].address, + rawAmount: parseUnits('100', scUSD.decimals), + decimals: scUSD.decimals, }, { - address: createPoolInput.tokens[0].address, - rawAmount: parseUnits(INIT_AMOUNT, DAI.decimals), - decimals: DAI.decimals, + address: createPoolInput.tokens[1].address, + rawAmount: parseUnits('100', scDAI.decimals), + decimals: scDAI.decimals, }, ], - minBptAmountOut: parseEther('1'), + minBptAmountOut: parseEther('10'), chainId, }; @@ -144,7 +142,6 @@ describe('Create Stable Pool tests', () => { testAddress, initPoolInput, poolState, - initPool: new InitPool(), slippage: Slippage.fromPercentage('0.01'), }); diff --git a/test/v3/createPool/stable/stable.validation.test.ts b/test/v3/createPool/stable/stable.validation.test.ts index 3853dd28..bd8f3534 100644 --- a/test/v3/createPool/stable/stable.validation.test.ts +++ b/test/v3/createPool/stable/stable.validation.test.ts @@ -15,7 +15,7 @@ import { MAX_TOKENS, } from 'src/entities/inputValidator/stable/inputValidatorStable'; -describe('Create stable pool input validation tests', () => { +describe('create stable pool input validations', () => { const chainId = ChainId.SEPOLIA; const createPool = new CreatePool(); let createStablePoolInput: CreatePoolV3StableInput; @@ -48,8 +48,6 @@ describe('Create stable pool input validation tests', () => { enableDonation: false, disableUnbalancedLiquidity: false, }; - - console.log('createStablePoolInput', createStablePoolInput); }); test('Should throw error if duplicate token addresses', async () => { diff --git a/test/v3/createPool/weighted/weighted.integration.test.ts b/test/v3/createPool/weighted/weighted.integration.test.ts index 2b88f11b..2f8d69a1 100644 --- a/test/v3/createPool/weighted/weighted.integration.test.ts +++ b/test/v3/createPool/weighted/weighted.integration.test.ts @@ -18,7 +18,6 @@ import { TokenType, CreatePoolV3WeightedInput, InitPoolDataProvider, - InitPool, Slippage, } from 'src'; import { ANVIL_NETWORKS, startFork } from '../../../anvil/anvil-global-setup'; @@ -30,10 +29,12 @@ import { PublicWalletClient } from '@/utils'; import { VAULT_V3 } from 'src/utils/constants'; import { vaultExtensionAbi_V3 } from 'src/abi/'; -describe('Create Weighted Pool tests', () => { +describe('create weighted pool test', () => { + const protocolVersion = 3; const chainId = ChainId.SEPOLIA; const poolType = PoolType.Weighted; - const protocolVersion = 3; + const BAL = TOKENS[chainId].BAL; + const WETH = TOKENS[chainId].WETH; let rpcUrl: string; let client: PublicWalletClient & TestActions; @@ -58,13 +59,13 @@ describe('Create Weighted Pool tests', () => { symbol: '50BAL-50WETH', tokens: [ { - address: TOKENS[chainId].BAL.address, // BAL + address: BAL.address, weight: parseEther(`${1 / 2}`), rateProvider: zeroAddress, tokenType: TokenType.STANDARD, }, { - address: TOKENS[chainId].WETH.address, // WETH + address: WETH.address, weight: parseEther(`${1 / 2}`), rateProvider: zeroAddress, tokenType: TokenType.STANDARD, @@ -113,7 +114,7 @@ describe('Create Weighted Pool tests', () => { client, testAddress, [...poolState.tokens.map((t) => t.address)], - [3, 1], + [WETH.slot!, BAL.slot!], [...poolState.tokens.map((t) => parseUnits('100', t.decimals))], undefined, protocolVersion, @@ -124,12 +125,12 @@ describe('Create Weighted Pool tests', () => { { address: createPoolInput.tokens[0].address, rawAmount: parseEther('100'), - decimals: 18, + decimals: BAL.decimals, }, { address: createPoolInput.tokens[1].address, rawAmount: parseEther('100'), - decimals: 18, + decimals: WETH.decimals, }, ], minBptAmountOut: parseEther('90'), @@ -141,7 +142,6 @@ describe('Create Weighted Pool tests', () => { testAddress, initPoolInput, poolState, - initPool: new InitPool(), slippage: Slippage.fromPercentage('0.01'), }); diff --git a/test/v3/createPool/weighted/weighted.validation.test.ts b/test/v3/createPool/weighted/weighted.validation.test.ts index 066518ce..d87d6b32 100644 --- a/test/v3/createPool/weighted/weighted.validation.test.ts +++ b/test/v3/createPool/weighted/weighted.validation.test.ts @@ -10,7 +10,7 @@ import { } from 'src'; import { TOKENS } from 'test/lib/utils/addresses'; -describe('Create weighted pool input validation tests', () => { +describe('create weighted pool input validations', () => { const chainId = ChainId.SEPOLIA; const createPool = new CreatePool(); let createWeightedPoolInput: CreatePoolV3WeightedInput;