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:
parent
1bf8b9fefa
commit
29ecdd555f
@ -1,6 +1,6 @@
|
|||||||
import ContractLoader from './contractLoader'
|
import ContractLoader from './contractLoader'
|
||||||
import KeeperBase from './keeper-base'
|
import KeeperBase from './keeper-base'
|
||||||
import { Logger } from '../utils/logger'
|
import Logger from '../utils/logger'
|
||||||
|
|
||||||
export default class OceanToken extends KeeperBase {
|
export default class OceanToken extends KeeperBase {
|
||||||
constructor(web3, network) {
|
constructor(web3, network) {
|
||||||
@ -10,7 +10,7 @@ export default class OceanToken extends KeeperBase {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
async getInstance() {
|
async getInstance() {
|
||||||
instance.contract = ContractLoader.load('OceanToken', instance._network, instance._web3)
|
instance.contract = await ContractLoader.load('OceanToken', instance._network, instance._web3)
|
||||||
|
|
||||||
return instance
|
return instance
|
||||||
}
|
}
|
||||||
@ -24,7 +24,7 @@ export default class OceanToken extends KeeperBase {
|
|||||||
getEthBalance(account) {
|
getEthBalance(account) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
Logger.log('getting balance for', account)
|
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)
|
if (err) return reject(err)
|
||||||
Logger.log('balance', balance)
|
Logger.log('balance', balance)
|
||||||
resolve(balance)
|
resolve(balance)
|
||||||
|
Loading…
Reference in New Issue
Block a user