1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

added await, fixed logger

This commit is contained in:
Sebastian Gerske 2018-09-19 14:09:11 +02:00
parent 1bf8b9fefa
commit 29ecdd555f

View File

@ -1,6 +1,6 @@
import ContractLoader from './contractLoader'
import KeeperBase from './keeper-base'
import { Logger } from '../utils/logger'
import Logger from '../utils/logger'
export default class OceanToken extends KeeperBase {
constructor(web3, network) {
@ -10,7 +10,7 @@ export default class OceanToken extends KeeperBase {
return {
async getInstance() {
instance.contract = ContractLoader.load('OceanToken', instance._network, instance._web3)
instance.contract = await ContractLoader.load('OceanToken', instance._network, instance._web3)
return instance
}
@ -24,7 +24,7 @@ export default class OceanToken extends KeeperBase {
getEthBalance(account) {
return new Promise((resolve, reject) => {
Logger.log('getting balance for', account)
super._web3.eth.getBalance(account, 'latest', (err, balance) => {
this._web3.eth.getBalance(account, 'latest', (err, balance) => {
if (err) return reject(err)
Logger.log('balance', balance)
resolve(balance)