|
|
@ -1,7 +1,3 @@ |
|
|
|
/* global */ |
|
|
|
|
|
|
|
'use strict' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var yo = require('yo-yo') |
|
|
|
|
|
|
|
var async = require('async') |
|
|
|
var async = require('async') |
|
|
|
var ethJSUtil = require('ethereumjs-util') |
|
|
|
var ethJSUtil = require('ethereumjs-util') |
|
|
|
var BN = ethJSUtil.BN |
|
|
|
var BN = ethJSUtil.BN |
|
|
@ -17,8 +13,7 @@ function UniversalDApp (globalRegistry) { |
|
|
|
this.data = {} |
|
|
|
this.data = {} |
|
|
|
this._deps = { |
|
|
|
this._deps = { |
|
|
|
config: globalRegistry.get('config').api, |
|
|
|
config: globalRegistry.get('config').api, |
|
|
|
compiler: globalRegistry.get('compiler').api, |
|
|
|
compiler: globalRegistry.get('compiler').api |
|
|
|
logCallback: globalRegistry.get('logCallback').api |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
executionContext.event.register('contextChanged', this, function (context) { |
|
|
|
executionContext.event.register('contextChanged', this, function (context) { |
|
|
|
self.resetEnvironment() |
|
|
|
self.resetEnvironment() |
|
|
@ -50,10 +45,8 @@ UniversalDApp.prototype.resetEnvironment = function () { |
|
|
|
this.txRunner = new TxRunner(this.accounts, this._txRunnerAPI) |
|
|
|
this.txRunner = new TxRunner(this.accounts, this._txRunnerAPI) |
|
|
|
this.txRunner.event.register('transactionBroadcasted', (txhash) => { |
|
|
|
this.txRunner.event.register('transactionBroadcasted', (txhash) => { |
|
|
|
executionContext.detectNetwork((error, network) => { |
|
|
|
executionContext.detectNetwork((error, network) => { |
|
|
|
if (!error && network) { |
|
|
|
if (error || !network) return |
|
|
|
var txLink = executionContext.txDetailsLink(network.name, txhash) |
|
|
|
this.event.trigger('transactionBroadcasted', [txhash, network.name]) |
|
|
|
if (txLink) this._deps.logCallback(yo`<a href="${txLink}" target="_blank">${txLink}</a>`) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|