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:
parent
6b02337869
commit
bf060948a8
14
package-lock.json
generated
14
package-lock.json
generated
@ -9,7 +9,7 @@
|
|||||||
"version": "1.0.0-next.42",
|
"version": "1.0.0-next.42",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oceanprotocol/contracts": "^1.0.0-alpha.32",
|
"@oceanprotocol/contracts": "^1.0.0-alpha.33",
|
||||||
"bignumber.js": "^9.0.2",
|
"bignumber.js": "^9.0.2",
|
||||||
"cross-fetch": "^3.1.5",
|
"cross-fetch": "^3.1.5",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
@ -2471,9 +2471,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@oceanprotocol/contracts": {
|
"node_modules/@oceanprotocol/contracts": {
|
||||||
"version": "1.0.0-alpha.32",
|
"version": "1.0.0-alpha.33",
|
||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.32.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.33.tgz",
|
||||||
"integrity": "sha512-gCHw4ZVnNjSozzCVT/cQiDqLNP0Xvy4fe+g5PKy8rwMR/h2rRW65Txi6wkb4HfZiUPKCdHbzpUFOwYfJFbW0Jw=="
|
"integrity": "sha512-jx8fg9src7fjeqMXB2ZYLdp0BoJA0G5vau6pa48YOjasDuPekJtPdT0oRy0PVkyJ2HtkYjAwKVyiFfAbZcug6A=="
|
||||||
},
|
},
|
||||||
"node_modules/@octokit/auth-token": {
|
"node_modules/@octokit/auth-token": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
@ -19610,9 +19610,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@oceanprotocol/contracts": {
|
"@oceanprotocol/contracts": {
|
||||||
"version": "1.0.0-alpha.32",
|
"version": "1.0.0-alpha.33",
|
||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.32.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.0.0-alpha.33.tgz",
|
||||||
"integrity": "sha512-gCHw4ZVnNjSozzCVT/cQiDqLNP0Xvy4fe+g5PKy8rwMR/h2rRW65Txi6wkb4HfZiUPKCdHbzpUFOwYfJFbW0Jw=="
|
"integrity": "sha512-jx8fg9src7fjeqMXB2ZYLdp0BoJA0G5vau6pa48YOjasDuPekJtPdT0oRy0PVkyJ2HtkYjAwKVyiFfAbZcug6A=="
|
||||||
},
|
},
|
||||||
"@octokit/auth-token": {
|
"@octokit/auth-token": {
|
||||||
"version": "2.5.0",
|
"version": "2.5.0",
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
"web3": "^1.7.3"
|
"web3": "^1.7.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@oceanprotocol/contracts": "^1.0.0-alpha.32",
|
"@oceanprotocol/contracts": "^1.0.0-alpha.33",
|
||||||
"bignumber.js": "^9.0.2",
|
"bignumber.js": "^9.0.2",
|
||||||
"cross-fetch": "^3.1.5",
|
"cross-fetch": "^3.1.5",
|
||||||
"crypto-js": "^4.1.1",
|
"crypto-js": "^4.1.1",
|
||||||
|
@ -329,25 +329,6 @@ export class Pool {
|
|||||||
return result
|
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
|
* Get if a token is bounded to a pool
|
||||||
* Returns true if token is bound
|
* Returns true if token is bound
|
||||||
|
@ -1020,20 +1020,6 @@ export class FixedRateExchange {
|
|||||||
return trxReceipt
|
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
|
* Get Router address set in fixed rate contract
|
||||||
* @return {String}
|
* @return {String}
|
||||||
|
@ -468,13 +468,6 @@ describe('Pool unit test', () => {
|
|||||||
assert((await pool.getMarketFeeCollector(poolAddress)) === factoryOwner)
|
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 () => {
|
it('#collectCommunityFee- should get community fees for each token', async () => {
|
||||||
const spotPriceBefore = await pool.getSpotPrice(
|
const spotPriceBefore = await pool.getSpotPrice(
|
||||||
poolAddress,
|
poolAddress,
|
||||||
@ -953,13 +946,6 @@ describe('Pool unit test', () => {
|
|||||||
assert((await pool.getMarketFeeCollector(poolAddress)) === factoryOwner)
|
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 () => {
|
it('#getCurrentMarketFees- should get curent market fees for each token', async () => {
|
||||||
const currentMarketFees: CurrentFees = await pool.getCurrentMarketFees(poolAddress)
|
const currentMarketFees: CurrentFees = await pool.getCurrentMarketFees(poolAddress)
|
||||||
assert(currentMarketFees !== null)
|
assert(currentMarketFees !== null)
|
||||||
|
@ -132,11 +132,6 @@ describe('Fixed Rate unit test', () => {
|
|||||||
it('#getOwner - should get exchange owner given an id', async () => {
|
it('#getOwner - should get exchange owner given an id', async () => {
|
||||||
expect(await fixedRate.getExchangeOwner(exchangeId)).to.equal(exchangeOwner)
|
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 () => {
|
it('#getRouter - should get Router address', async () => {
|
||||||
expect(await fixedRate.getRouter()).to.equal(contracts.routerAddress)
|
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 () => {
|
it('#getOwner - should get exchange owner given an id', async () => {
|
||||||
expect(await fixedRate.getExchangeOwner(exchangeId)).to.equal(exchangeOwner)
|
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 () => {
|
it('#getRouter - should get Router address', async () => {
|
||||||
expect(await fixedRate.getRouter()).to.equal(contracts.routerAddress)
|
expect(await fixedRate.getRouter()).to.equal(contracts.routerAddress)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user