Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kremalicious committed Aug 20, 2020
1 parent a3e43c1 commit af7964c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/balancer/Pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,17 @@ export class Pool extends PoolFactory {
type: 'function'
}
] as AbiItem[]
const token = new this.web3.eth.Contract(minABI, poolAddress, {
from: account
})

let result = null

try {
result = this.web3.utils.fromWei(
await token.methods
.balanceOf(account)
.call({ from: account, gas: this.GASLIMIT_DEFAULT })
)
const token = new this.web3.eth.Contract(minABI, poolAddress, {
from: account
})
const balance = await token.methods
.balanceOf(account)
.call({ from: account, gas: this.GASLIMIT_DEFAULT })
result = this.web3.utils.fromWei(balance)
} catch (e) {
console.error(e)
}
Expand Down Expand Up @@ -154,12 +155,10 @@ export class Pool extends PoolFactory {
}
] as AbiItem[]

const token = new this.web3.eth.Contract(minABI, poolAddress)
// const pool = new this.web3.eth.Contract(this.poolABI, poolAddress)

let result = null

try {
const token = new this.web3.eth.Contract(minABI, poolAddress)
const totalSupply = await token.methods.totalSupply().call()
result = this.web3.utils.fromWei(totalSupply)
} catch (e) {
Expand Down

0 comments on commit af7964c

Please sign in to comment.