From a6d79c020a557bb34b4f986942e740d5adf4ce0a Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Tue, 13 Oct 2020 10:10:58 -0700 Subject: [PATCH] fix balancer test --- test/unit/balancer/Balancer.test.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/unit/balancer/Balancer.test.ts b/test/unit/balancer/Balancer.test.ts index d5208885..c4fe4c9a 100644 --- a/test/unit/balancer/Balancer.test.ts +++ b/test/unit/balancer/Balancer.test.ts @@ -14,6 +14,13 @@ import OceanPoolFactory from '@oceanprotocol/contracts/artifacts/BFactory.json' import OceanSPool from '@oceanprotocol/contracts/artifacts/BPool.json' const web3 = new Web3('http://127.0.0.1:8545') + +function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms) + }) +} + describe('Balancer flow', () => { let oceanTokenAddress: string let OceanPoolFactoryAddress: string @@ -116,7 +123,7 @@ describe('Balancer flow', () => { it('Alice creates a new OceanPool pool', async () => { /// new pool with total DT = 45 , dt weight=90% with swap fee 2% alicePoolAddress = await Pool.createDTPool(alice, tokenAddress, '45', '9', '0.02') - const s = await Pool.totalSupply(alicePoolAddress) + const s = await Pool.getPoolSharesTotalSupply(alicePoolAddress) assert(String(s) === '100', 'totalSupply does not match: ' + s) const n = await Pool.getNumTokens(alicePoolAddress) assert(String(n) === '2', 'unexpected num tokens: ' + n) @@ -164,7 +171,7 @@ describe('Balancer flow', () => { assert(Number(currentOceanReserve) > 0) }) it('Get total supply of pool tokens', async () => { - const totalSupply = await Pool.totalSupply(alicePoolAddress) + const totalSupply = await Pool.getPoolSharesTotalSupply(alicePoolAddress) assert(Number(totalSupply) > 0) }) it('Get amount of Ocean needed to buy 1 dtToken', async () => {