Skip to content

Commit

Permalink
fix: should fetch data for all linear pools
Browse files Browse the repository at this point in the history
  • Loading branch information
gmbronco committed Aug 31, 2023
1 parent 725988b commit 71aed4a
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 61 deletions.
7 changes: 2 additions & 5 deletions balancer-js/src/modules/data/pool/onchain-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,10 @@ const poolTypeCalls = (poolType: string, poolTypeVersion = 1) => {
} else {
return do_nothing;
}
case 'AaveLinear':
if (poolTypeVersion === 1) {
default:
if (poolType.includes('Linear')) {
return linearCalls;
} else {
return do_nothing;
}
default:
return do_nothing;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('generalised exit execution', async function () {
});
});

context.skip('ERC4626 - bbausd3', async () => {
context('ERC4626 - bbausd3', async () => {
if (!TEST_BBAUSD3) return true;
const network = Network.MAINNET;
const pool = ADDRESSES[network].bbausd3;
Expand Down Expand Up @@ -113,7 +113,7 @@ describe('generalised exit execution', async function () {
});
});

context.skip('GearboxLinear - bbgusd', async () => {
context('GearboxLinear - bbgusd', async () => {
const network = Network.MAINNET;
const pool = ADDRESSES[network].bbgusd;
const slippage = '10'; // 10 bps = 0.1%
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('generalised exit execution', async function () {
});
});

context.skip('AaveLinear - bbausd2', async () => {
context('AaveLinear - bbausd2', async () => {
const network = Network.MAINNET;
const pool = ADDRESSES[network].bbausd2;
const slippage = '10'; // 10 bps = 0.1%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const poolAddresses = Object.values(ADDRESSES[network]).map(
);
const addresses = ADDRESSES[network];

describe.skip('generalised exit execution', async function () {
describe('generalised exit execution', async function () {
this.timeout(120000); // Sets timeout for all tests within this scope to 2 minutes

/*
Expand Down Expand Up @@ -224,7 +224,7 @@ describe.skip('generalised exit execution', async function () {
b-a-weth: Linear, aWeth/Weth
b-a-usd2: ComposableStable, b-a-usdt/b-a-usdc/b-a-dai
*/
context.skip('boostedWeightedMetaGeneral', async () => {
context('boostedWeightedMetaGeneral', async () => {
if (!TEST_BOOSTED_WEIGHTED_META_GENERAL) return true;
const pool = addresses.boostedWeightedMetaGeneral1;
const amount = parseFixed('0.05', pool.decimals).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('generalised exit execution', async () => {
},
]);
});
context.skip('composable stable pool - boosted', async () => {
context('composable stable pool - boosted', async () => {
const testPool = addresses.bbgusd;
await runTests([
{
Expand All @@ -67,7 +67,7 @@ describe('generalised exit execution', async () => {
},
]);
});
context.skip('weighted with boosted', async () => {
context('weighted with boosted', async () => {
const testPool = addresses.STG_BBAUSD;
await runTests([
{
Expand Down
95 changes: 46 additions & 49 deletions balancer-js/src/modules/joins/joins.module.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,55 +105,52 @@ describe('generalised join execution', async function () {
});
});

context.skip(
'join with wETH vs ETH - where first step is a swap',
async () => {
if (!TEST_JOIN_WITH_ETH_SWAP_FIRST) return true;

before(async () => {
testPool = addresses.swEth_bbaweth;
tokens = [addresses.WETH, addresses.swETH];
balances = [
parseFixed('10', addresses.WETH.decimals).toString(),
parseFixed('10', addresses.swETH.decimals).toString(),
];
});

it('should join with wETH', async () => {
const tokensIn = [addresses.WETH.address, addresses.swETH.address];
const amountsIn = [
parseFixed('1', addresses.WETH.decimals).toString(),
parseFixed('1', addresses.swETH.decimals).toString(),
];
await testGeneralisedJoin(
sdk,
signer,
userAddress,
testPool,
tokensIn,
amountsIn,
simulationType
);
});

it('should join with ETH', async () => {
const tokensIn = [AddressZero, addresses.swETH.address];
const amountsIn = [
parseFixed('1', 18).toString(),
parseFixed('1', addresses.swETH.decimals).toString(),
];
await testGeneralisedJoin(
sdk,
signer,
userAddress,
testPool,
tokensIn,
amountsIn,
simulationType
);
});
}
);
context('join with wETH vs ETH - where first step is a swap', async () => {
if (!TEST_JOIN_WITH_ETH_SWAP_FIRST) return true;

before(async () => {
testPool = addresses.swEth_bbaweth;
tokens = [addresses.WETH, addresses.swETH];
balances = [
parseFixed('10', addresses.WETH.decimals).toString(),
parseFixed('10', addresses.swETH.decimals).toString(),
];
});

it('should join with wETH', async () => {
const tokensIn = [addresses.WETH.address, addresses.swETH.address];
const amountsIn = [
parseFixed('1', addresses.WETH.decimals).toString(),
parseFixed('1', addresses.swETH.decimals).toString(),
];
await testGeneralisedJoin(
sdk,
signer,
userAddress,
testPool,
tokensIn,
amountsIn,
simulationType
);
});

it('should join with ETH', async () => {
const tokensIn = [AddressZero, addresses.swETH.address];
const amountsIn = [
parseFixed('1', 18).toString(),
parseFixed('1', addresses.swETH.decimals).toString(),
];
await testGeneralisedJoin(
sdk,
signer,
userAddress,
testPool,
tokensIn,
amountsIn,
simulationType
);
});
});

context('join with wETH vs ETH - where first step is a join', async () => {
if (!TEST_JOIN_WITH_ETH_JOIN_FIRST) return true;
Expand Down

0 comments on commit 71aed4a

Please sign in to comment.