Skip to content

Commit

Permalink
Merge pull request #416 from balancer/fix-gyro-fx-tests
Browse files Browse the repository at this point in the history
Fixing the gyroEV2.integration.spec.ts tests;
  • Loading branch information
lgahdl authored Sep 12, 2023
2 parents feaae58 + 64f94da commit f204ddc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions test/gyroEV2.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { setUp } from './testScripts/utils';
dotenv.config();

const networkId = Network.POLYGON;
const jsonRpcUrl = '';
const jsonRpcUrl = process.env.RPC_URL_POLYGON ?? '';
const rpcUrl = 'http://127.0.0.1:8137';
const provider = new JsonRpcProvider(rpcUrl, networkId);
const blocknumber = 42173266;
const blocknumber = 47427007;

const vault = Vault__factory.connect(vaultAddr, provider);

Expand Down Expand Up @@ -64,7 +64,7 @@ const gyroEV2PoolWMATIC_stMATIC_POLYGON: SubgraphPoolBase = {
dSq: '0.9999999999999999988662409334210612',
};

describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
describe('gyroEV2: WMATIC-stMATIC integration tests', () => {
let sor: SOR;
const funds = {
sender: AddressZero,
Expand All @@ -91,21 +91,20 @@ describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
it('should return no swaps when above limit', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].WMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].stMATIC.address;
const swapAmount = parseFixed('33.33333333333333', 18);
const swapAmount = parseFixed('100000000', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
swapType,
swapAmount
);

expect(swapInfo.swaps.length).to.eq(0);
expect(swapInfo.returnAmount.toString()).to.eq('0');
});
it('token > LSD, getSwaps result should match queryBatchSwap', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].WMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].stMATIC.address;
const swapAmount = parseFixed('1.12345678', 18);
const swapAmount = parseFixed('1603426', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
Expand All @@ -130,7 +129,7 @@ describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
it('LSD > token, getSwaps result should match queryBatchSwap', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].stMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].WMATIC.address;
const swapAmount = parseFixed('0.999', 18);
const swapAmount = parseFixed('160342', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
Expand Down Expand Up @@ -160,7 +159,7 @@ describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
it('should return no swaps when above limit', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].WMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].stMATIC.address;
const swapAmount = parseFixed('100', 18);
const swapAmount = parseFixed('100000000', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
Expand All @@ -174,7 +173,7 @@ describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
it('token > LSD, getSwaps result should match queryBatchSwap', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].WMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].stMATIC.address;
const swapAmount = parseFixed('1.987654321', 18);
const swapAmount = parseFixed('1603426', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
Expand All @@ -198,7 +197,7 @@ describe.skip('gyroEV2: WMATIC-stMATIC integration tests', () => {
it('LSD > token, getSwaps result should match queryBatchSwap', async () => {
const tokenIn = ADDRESSES[Network.POLYGON].stMATIC.address;
const tokenOut = ADDRESSES[Network.POLYGON].WMATIC.address;
const swapAmount = parseFixed('0.999', 18);
const swapAmount = parseFixed('1603420', 18);
const swapInfo = await sor.getSwaps(
tokenIn,
tokenOut,
Expand Down
2 changes: 1 addition & 1 deletion test/xaveFxPool.polygon.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const xaveFxPoolXSGD_USDC_POLYGON: SubgraphPoolBase = {
epsilon: '0.0005',
};

describe.skip('xaveFxPool: DAI-USDC integration (Polygon) tests', () => {
describe('xaveFxPool: DAI-USDC integration (Polygon) tests', () => {
context('test swaps vs queryBatchSwap', () => {
// Setup chain
before(async function () {
Expand Down

0 comments on commit f204ddc

Please sign in to comment.