Skip to content

Commit

Permalink
fix stable pool initialization test
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira committed Oct 2, 2024
1 parent 4bfda14 commit 0d2c6b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
30 changes: 16 additions & 14 deletions test/v3/createPool/stable/stable.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe('Create Stable Pool tests', () => {
const poolType = PoolType.Stable;
const protocolVersion = 3;
const DAI = TOKENS[chainId].DAI;
const USDC = TOKENS[chainId].USDC;
const BAL = TOKENS[chainId].BAL;
const INIT_AMOUNT = '100';

let rpcUrl: string;
let client: PublicWalletClient & TestActions;
Expand All @@ -56,6 +57,8 @@ describe('Create Stable Pool tests', () => {

createPoolInput = {
poolType,
chainId,
protocolVersion,
name: 'DAI USDC Stable Pool',
symbol: 'DAI-USDC',
amplificationParameter: 420n,
Expand All @@ -67,7 +70,7 @@ describe('Create Stable Pool tests', () => {
paysYieldFees: false,
},
{
address: USDC.address,
address: BAL.address,
rateProvider: zeroAddress,
tokenType: TokenType.STANDARD,
paysYieldFees: false,
Expand All @@ -78,8 +81,6 @@ describe('Create Stable Pool tests', () => {
pauseManager: testAddress,
swapFeeManager: testAddress,
disableUnbalancedLiquidity: false,
chainId,
protocolVersion,
enableDonation: false,
};

Expand Down Expand Up @@ -110,27 +111,28 @@ describe('Create Stable Pool tests', () => {
poolType,
protocolVersion,
);

await forkSetup(
client,
testAddress,
[...poolState.tokens.map((t) => t.address)],
[3, 1],
[...poolState.tokens.map((t) => parseUnits('100', t.decimals))],
poolState.tokens.map((t) => t.address),
[BAL.slot!, DAI.slot!],
poolState.tokens.map((t) => parseUnits(INIT_AMOUNT, t.decimals)),
undefined,
protocolVersion,
);

const initPoolInput = {
amountsIn: [
{
address: createPoolInput.tokens[0].address,
rawAmount: parseEther('10'),
decimals: DAI.decimals,
address: createPoolInput.tokens[1].address,
rawAmount: parseUnits(INIT_AMOUNT, BAL.decimals),
decimals: BAL.decimals,
},
{
address: createPoolInput.tokens[1].address,
rawAmount: parseEther('10'),
decimals: USDC.decimals,
address: createPoolInput.tokens[0].address,
rawAmount: parseUnits(INIT_AMOUNT, DAI.decimals),
decimals: DAI.decimals,
},
],
minBptAmountOut: parseEther('1'),
Expand All @@ -143,7 +145,7 @@ describe('Create Stable Pool tests', () => {
initPoolInput,
poolState,
initPool: new InitPool(),
slippage: Slippage.fromPercentage('0.1'),
slippage: Slippage.fromPercentage('0.01'),
});

assertInitPool(initPoolInput, addLiquidityOutput);
Expand Down
4 changes: 2 additions & 2 deletions test/v3/createPool/weighted/weighted.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Create Weighted Pool tests', () => {
client = createTestClient({
mode: 'anvil',
chain: CHAINS[chainId],
transport: http(rpcUrl, { timeout: 120_000 }),
transport: http(rpcUrl, { timeout: 120_000 }), // // FIXME: createPool step takes a long time, so we increase the timeout as a temporary solution
})
.extend(publicActions)
.extend(walletActions);
Expand Down Expand Up @@ -146,5 +146,5 @@ describe('Create Weighted Pool tests', () => {
});

assertInitPool(initPoolInput, addLiquidityOutput);
});
}, 120_000);
});

0 comments on commit 0d2c6b2

Please sign in to comment.