Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
johngrantuk committed May 22, 2023
1 parent 0e1243f commit e131c9d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const signer = provider.getSigner();
const testPoolId =
'0x726e324c29a1e49309672b244bdc4ff62a270407000200000000000000000702';
let pool: PoolWithMethods;
const blockNumber = 42505555;
const blockNumber = 43015527;

describe('FX Pool - Calculate Liquidity', () => {
const sdkConfig = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// yarn test:only ./src/modules/pools/pool-types/concerns/fx/liquidity.concern.integration.spec.ts
// yarn test:only ./src/modules/pools/pool-types/concerns/gyro/liquidity.concern.integration.spec.ts
import dotenv from 'dotenv';
import { Network, PoolWithMethods } from '@/types';
import { forkSetup, TestPoolHelper } from '@/test/lib/utils';
Expand All @@ -16,7 +16,7 @@ const rpcUrlLocal = 'http://127.0.0.1:8137';

const provider = new ethers.providers.JsonRpcProvider(rpcUrlLocal, network);
const signer = provider.getSigner();
const blockNumber = 42505555;
const blockNumber = 43015527;

describe('Gyro Pools - Calculate Liquidity', () => {
const sdkConfig = {
Expand Down
33 changes: 28 additions & 5 deletions balancer-js/src/modules/pools/pools.integration.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
import { expect } from 'chai';
import { BalancerSDK, Network, Pool, PoolWithMethods, Pools } from '@/.';
import {
BalancerSDK,
Network,
Pool,
PoolWithMethods,
Pools,
GraphQLQuery,
GraphQLArgs,
} from '@/.';
import { AddressZero, Zero } from '@ethersproject/constants';
import { bn } from '@/lib/utils';
import { poolFactory } from '@/test/factories/sdk';
import { BALANCER_NETWORK_CONFIG } from '@/lib/constants/config';

const rpcUrl = 'http://127.0.0.1:8545';
const network = Network.MAINNET;
const sdk = new BalancerSDK({ network, rpcUrl });
const { pools, contracts } = sdk;
const { balancerHelpers } = contracts;

const ethStEth =
'0x32296969ef14eb0c6d29669c550d4a0449130230000200000000000000000080';
const subgraphArgs: GraphQLArgs = {
where: {
swapEnabled: {
eq: true,
},
totalShares: {
gt: 0.000000000001,
},
address: {
in: [ethStEth],
},
},
orderBy: 'totalLiquidity',
orderDirection: 'desc',
};
const subgraphQuery: GraphQLQuery = { args: subgraphArgs, attrs: {} };
const sdk = new BalancerSDK({ network, rpcUrl, subgraphQuery });
const { pools, contracts } = sdk;
const { balancerHelpers } = contracts;

describe('pools module', () => {
describe('methods', () => {
Expand Down

0 comments on commit e131c9d

Please sign in to comment.