From bf060948a8c056bfac137c51b836fec019a5610a Mon Sep 17 00:00:00 2001 From: Alex Coseru Date: Tue, 17 May 2022 12:04:51 +0300 Subject: [PATCH] bump contracts to alpha.33 (#1472) * bump contracts * remove getOPCCollector --- package-lock.json | 14 +++++++------- package.json | 2 +- src/pools/balancer/Pool.ts | 19 ------------------- src/pools/fixedRate/FixedRateExchange.ts | 14 -------------- test/unit/pools/balancer/Pool.test.ts | 14 -------------- .../pools/fixedRate/FixedRateExchange.test.ts | 10 ---------- 6 files changed, 8 insertions(+), 65 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5011c2a..bdca0a73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0-next.42", "license": "Apache-2.0", "dependencies": { - "@oceanprotocol/contracts": "^1.0.0-alpha.32", + "@oceanprotocol/contracts": "^1.0.0-alpha.33", "bignumber.js": "^9.0.2", "cross-fetch": "^3.1.5", "crypto-js": "^4.1.1", @@ -2471,9 +2471,9 @@ } }, "node_modules/@oceanprotocol/contracts": { - "version": "1.0.0-alpha.32", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.32.tgz", - "integrity": "sha512-gCHw4ZVnNjSozzCVT/cQiDqLNP0Xvy4fe+g5PKy8rwMR/h2rRW65Txi6wkb4HfZiUPKCdHbzpUFOwYfJFbW0Jw==" + "version": "1.0.0-alpha.33", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.33.tgz", + "integrity": "sha512-jx8fg9src7fjeqMXB2ZYLdp0BoJA0G5vau6pa48YOjasDuPekJtPdT0oRy0PVkyJ2HtkYjAwKVyiFfAbZcug6A==" }, "node_modules/@octokit/auth-token": { "version": "2.5.0", @@ -19610,9 +19610,9 @@ } }, "@oceanprotocol/contracts": { - "version": "1.0.0-alpha.32", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.32.tgz", - "integrity": "sha512-gCHw4ZVnNjSozzCVT/cQiDqLNP0Xvy4fe+g5PKy8rwMR/h2rRW65Txi6wkb4HfZiUPKCdHbzpUFOwYfJFbW0Jw==" + "version": "1.0.0-alpha.33", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.33.tgz", + "integrity": "sha512-jx8fg9src7fjeqMXB2ZYLdp0BoJA0G5vau6pa48YOjasDuPekJtPdT0oRy0PVkyJ2HtkYjAwKVyiFfAbZcug6A==" }, "@octokit/auth-token": { "version": "2.5.0", diff --git a/package.json b/package.json index 8951fc6e..90c14291 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "web3": "^1.7.3" }, "dependencies": { - "@oceanprotocol/contracts": "^1.0.0-alpha.32", + "@oceanprotocol/contracts": "^1.0.0-alpha.33", "bignumber.js": "^9.0.2", "cross-fetch": "^3.1.5", "crypto-js": "^4.1.1", diff --git a/src/pools/balancer/Pool.ts b/src/pools/balancer/Pool.ts index e5a22a97..95096265 100644 --- a/src/pools/balancer/Pool.ts +++ b/src/pools/balancer/Pool.ts @@ -329,25 +329,6 @@ export class Pool { return result } - /** - * Get OPC Collector of this pool - * @param {String} poolAddress - * @return {String} - */ - async getOPCCollector(poolAddress: string): Promise { - const pool = setContractDefaults( - new this.web3.eth.Contract(this.poolAbi, poolAddress), - this.config - ) - let result = null - try { - result = await pool.methods._opcCollector().call() - } catch (e) { - LoggerInstance.error(`ERROR: Failed to get OPF Collector address: ${e.message}`) - } - return result - } - /** * Get if a token is bounded to a pool * Returns true if token is bound diff --git a/src/pools/fixedRate/FixedRateExchange.ts b/src/pools/fixedRate/FixedRateExchange.ts index c73f03fb..75c381cf 100644 --- a/src/pools/fixedRate/FixedRateExchange.ts +++ b/src/pools/fixedRate/FixedRateExchange.ts @@ -1020,20 +1020,6 @@ export class FixedRateExchange { return trxReceipt } - /** - * Get OPF Collector of fixed rate contract - * @return {String} - */ - async getOPCCollector(): Promise { - let result = null - try { - result = await this.contract.methods.opcCollector().call() - } catch (e) { - LoggerInstance.error(`ERROR: Failed to get OPC Collector address: ${e.message}`) - } - return result - } - /** * Get Router address set in fixed rate contract * @return {String} diff --git a/test/unit/pools/balancer/Pool.test.ts b/test/unit/pools/balancer/Pool.test.ts index 68ce2b4e..1b2452c2 100644 --- a/test/unit/pools/balancer/Pool.test.ts +++ b/test/unit/pools/balancer/Pool.test.ts @@ -468,13 +468,6 @@ describe('Pool unit test', () => { assert((await pool.getMarketFeeCollector(poolAddress)) === factoryOwner) }) - it('#getOPCCollector- should get market fees for each token', async () => { - assert( - (await pool.getOPCCollector(poolAddress)) === - contracts.opfCommunityFeeCollectorAddress - ) - }) - it('#collectCommunityFee- should get community fees for each token', async () => { const spotPriceBefore = await pool.getSpotPrice( poolAddress, @@ -953,13 +946,6 @@ describe('Pool unit test', () => { assert((await pool.getMarketFeeCollector(poolAddress)) === factoryOwner) }) - it('#getOPCCollector- should get market fees for each token', async () => { - assert( - (await pool.getOPCCollector(poolAddress)) === - contracts.opfCommunityFeeCollectorAddress - ) - }) - it('#getCurrentMarketFees- should get curent market fees for each token', async () => { const currentMarketFees: CurrentFees = await pool.getCurrentMarketFees(poolAddress) assert(currentMarketFees !== null) diff --git a/test/unit/pools/fixedRate/FixedRateExchange.test.ts b/test/unit/pools/fixedRate/FixedRateExchange.test.ts index 28e43472..58744acd 100644 --- a/test/unit/pools/fixedRate/FixedRateExchange.test.ts +++ b/test/unit/pools/fixedRate/FixedRateExchange.test.ts @@ -132,11 +132,6 @@ describe('Fixed Rate unit test', () => { it('#getOwner - should get exchange owner given an id', async () => { expect(await fixedRate.getExchangeOwner(exchangeId)).to.equal(exchangeOwner) }) - it('#getOPFCollector - should get OPF collector', async () => { - expect(await fixedRate.getOPCCollector()).to.equal( - contracts.opfCommunityFeeCollectorAddress - ) - }) it('#getRouter - should get Router address', async () => { expect(await fixedRate.getRouter()).to.equal(contracts.routerAddress) }) @@ -453,11 +448,6 @@ describe('Fixed Rate unit test', () => { it('#getOwner - should get exchange owner given an id', async () => { expect(await fixedRate.getExchangeOwner(exchangeId)).to.equal(exchangeOwner) }) - it('#getOPFCollector - should get OPF collector', async () => { - expect(await fixedRate.getOPCCollector()).to.equal( - contracts.opfCommunityFeeCollectorAddress - ) - }) it('#getRouter - should get Router address', async () => { expect(await fixedRate.getRouter()).to.equal(contracts.routerAddress) })