mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fixed ocean allowance param and some lint errors
This commit is contained in:
parent
a5a55b19a1
commit
742436dbac
@ -119,9 +119,8 @@ export class OceanPool extends Pool {
|
||||
const oceanWeight = 10 - parseFloat(dtWeight)
|
||||
this.dtAddress = dtAddress
|
||||
let txid
|
||||
let dtAllowance
|
||||
dtAllowance = await this.allowance(dtAddress, account, address)
|
||||
if (dtAllowance < dtAmount){
|
||||
const dtAllowance = await this.allowance(dtAddress, account, address)
|
||||
if (dtAllowance < dtAmount) {
|
||||
observer.next(PoolCreateProgressStep.ApprovingDatatoken)
|
||||
txid = await this.approve(
|
||||
account,
|
||||
@ -132,11 +131,10 @@ export class OceanPool extends Pool {
|
||||
if (!txid) {
|
||||
this.logger.error('ERROR: Failed to call approve DT token')
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
let oceanAllowance
|
||||
oceanAllowance = await this.allowance(dtAddress, account, address)
|
||||
if (oceanAllowance < oceanAmount){
|
||||
const oceanAllowance = await this.allowance(this.oceanAddress, account, address)
|
||||
if (oceanAllowance < oceanAmount) {
|
||||
observer.next(PoolCreateProgressStep.ApprovingOcean)
|
||||
txid = await this.approve(
|
||||
account,
|
||||
|
@ -119,7 +119,7 @@ export class Pool extends PoolFactory {
|
||||
owner: string,
|
||||
spender: string
|
||||
): Promise<string> {
|
||||
const tokenAbi = (defaultDatatokensABI.abi as AbiItem[])
|
||||
const tokenAbi = defaultDatatokensABI.abi as AbiItem[]
|
||||
const datatoken = new this.web3.eth.Contract(tokenAbi, tokenAdress, {
|
||||
from: spender
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user