From e131c9da78cdac5ac4c28a9145422ecd96ef5e76 Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Mon, 22 May 2023 15:53:33 +0100 Subject: [PATCH] Update tests. --- .../fx/liquidity.concern.integration.spec.ts | 2 +- .../liquidity.concern.integration.spec.ts | 4 +-- .../modules/pools/pools.integration.spec.ts | 33 ++++++++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/balancer-js/src/modules/pools/pool-types/concerns/fx/liquidity.concern.integration.spec.ts b/balancer-js/src/modules/pools/pool-types/concerns/fx/liquidity.concern.integration.spec.ts index b3f8026d8..84d7b91ca 100644 --- a/balancer-js/src/modules/pools/pool-types/concerns/fx/liquidity.concern.integration.spec.ts +++ b/balancer-js/src/modules/pools/pool-types/concerns/fx/liquidity.concern.integration.spec.ts @@ -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 = { diff --git a/balancer-js/src/modules/pools/pool-types/concerns/gyro/liquidity.concern.integration.spec.ts b/balancer-js/src/modules/pools/pool-types/concerns/gyro/liquidity.concern.integration.spec.ts index 5660d1979..b74ea53b5 100644 --- a/balancer-js/src/modules/pools/pool-types/concerns/gyro/liquidity.concern.integration.spec.ts +++ b/balancer-js/src/modules/pools/pool-types/concerns/gyro/liquidity.concern.integration.spec.ts @@ -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'; @@ -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 = { diff --git a/balancer-js/src/modules/pools/pools.integration.spec.ts b/balancer-js/src/modules/pools/pools.integration.spec.ts index 8820f7d5a..cc89c7c56 100644 --- a/balancer-js/src/modules/pools/pools.integration.spec.ts +++ b/balancer-js/src/modules/pools/pools.integration.spec.ts @@ -1,5 +1,13 @@ 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'; @@ -7,12 +15,27 @@ 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', () => {