1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

bump contracts to alpha.33 (#1472)

* bump contracts
* remove getOPCCollector
This commit is contained in:
Alex Coseru 2022-05-17 12:04:51 +03:00 committed by GitHub
parent 6b02337869
commit bf060948a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 65 deletions

14
package-lock.json generated
View File

@ -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",

View File

@ -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",

View File

@ -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<string> {
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

View File

@ -1020,20 +1020,6 @@ export class FixedRateExchange {
return trxReceipt
}
/**
* Get OPF Collector of fixed rate contract
* @return {String}
*/
async getOPCCollector(): Promise<string> {
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}

View File

@ -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)

View File

@ -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)
})