|
|
@ -21,9 +21,7 @@ function UniversalDApp (executionContext, options, txdebugger) { |
|
|
|
self.$el = $('<div class="udapp" />') |
|
|
|
self.$el = $('<div class="udapp" />') |
|
|
|
self.personalMode = self.options.personalMode || false |
|
|
|
self.personalMode = self.options.personalMode || false |
|
|
|
self.contracts |
|
|
|
self.contracts |
|
|
|
self.getAddress |
|
|
|
self.transactionContextAPI |
|
|
|
self.getValue |
|
|
|
|
|
|
|
self.getGasLimit |
|
|
|
|
|
|
|
self.txdebugger = txdebugger // temporary: will not be needed anymore when we'll add memory support to the VM
|
|
|
|
self.txdebugger = txdebugger // temporary: will not be needed anymore when we'll add memory support to the VM
|
|
|
|
var defaultRenderOutputModifier = function (name, content) { return content } |
|
|
|
var defaultRenderOutputModifier = function (name, content) { return content } |
|
|
|
self.renderOutputModifier = defaultRenderOutputModifier |
|
|
|
self.renderOutputModifier = defaultRenderOutputModifier |
|
|
@ -39,12 +37,10 @@ function UniversalDApp (executionContext, options, txdebugger) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UniversalDApp.prototype.reset = function (contracts, getAddress, getValue, getGasLimit, renderer) { |
|
|
|
UniversalDApp.prototype.reset = function (contracts, transactionContextAPI, renderer) { |
|
|
|
this.$el.empty() |
|
|
|
this.$el.empty() |
|
|
|
this.contracts = contracts |
|
|
|
this.contracts = contracts |
|
|
|
this.getAddress = getAddress |
|
|
|
this.transactionContextAPI = transactionContextAPI |
|
|
|
this.getValue = getValue |
|
|
|
|
|
|
|
this.getGasLimit = getGasLimit |
|
|
|
|
|
|
|
this.renderOutputModifier = renderer |
|
|
|
this.renderOutputModifier = renderer |
|
|
|
this.accounts = {} |
|
|
|
this.accounts = {} |
|
|
|
if (this.executionContext.isVM()) { |
|
|
|
if (this.executionContext.isVM()) { |
|
|
@ -734,8 +730,8 @@ UniversalDApp.prototype.runTx = function (args, cb) { |
|
|
|
function (callback) { |
|
|
|
function (callback) { |
|
|
|
tx.gasLimit = 3000000 |
|
|
|
tx.gasLimit = 3000000 |
|
|
|
|
|
|
|
|
|
|
|
if (self.getGasLimit) { |
|
|
|
if (self.transactionContextAPI.getGasLimit) { |
|
|
|
self.getGasLimit(function (err, ret) { |
|
|
|
self.transactionContextAPI.getGasLimit(function (err, ret) { |
|
|
|
if (err) { |
|
|
|
if (err) { |
|
|
|
return callback(err) |
|
|
|
return callback(err) |
|
|
|
} |
|
|
|
} |
|
|
@ -751,8 +747,8 @@ UniversalDApp.prototype.runTx = function (args, cb) { |
|
|
|
function (callback) { |
|
|
|
function (callback) { |
|
|
|
tx.value = 0 |
|
|
|
tx.value = 0 |
|
|
|
|
|
|
|
|
|
|
|
if (self.getValue) { |
|
|
|
if (self.transactionContextAPI.getValue) { |
|
|
|
self.getValue(function (err, ret) { |
|
|
|
self.transactionContextAPI.getValue(function (err, ret) { |
|
|
|
if (err) { |
|
|
|
if (err) { |
|
|
|
return callback(err) |
|
|
|
return callback(err) |
|
|
|
} |
|
|
|
} |
|
|
@ -766,8 +762,8 @@ UniversalDApp.prototype.runTx = function (args, cb) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// query address
|
|
|
|
// query address
|
|
|
|
function (callback) { |
|
|
|
function (callback) { |
|
|
|
if (self.getAddress) { |
|
|
|
if (self.transactionContextAPI.getAddress) { |
|
|
|
self.getAddress(function (err, ret) { |
|
|
|
self.transactionContextAPI.getAddress(function (err, ret) { |
|
|
|
if (err) { |
|
|
|
if (err) { |
|
|
|
return callback(err) |
|
|
|
return callback(err) |
|
|
|
} |
|
|
|
} |
|
|
|