move execution context dependency from udapp-ui to udapp

pull/3094/head
Iuri Matias 7 years ago
parent ee29a6439b
commit 47f085121b
  1. 3
      src/universal-dapp-ui.js
  2. 4
      src/universal-dapp.js

@ -6,7 +6,6 @@ var remixLib = require('remix-lib')
var yo = require('yo-yo') var yo = require('yo-yo')
var txHelper = require('./app/execution/txHelper') var txHelper = require('./app/execution/txHelper')
var helper = require('./lib/helper') var helper = require('./lib/helper')
var executionContext = require('./execution-context')
var copyToClipboard = require('./app/ui/copy-to-clipboard') var copyToClipboard = require('./app/ui/copy-to-clipboard')
// -------------- styling ---------------------- // -------------- styling ----------------------
@ -171,7 +170,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
address = (address.slice(0, 2) === '0x' ? '' : '0x') + address.toString('hex') address = (address.slice(0, 2) === '0x' ? '' : '0x') + address.toString('hex')
var instance = yo`<div class="instance ${css.instance}" id="instance${address}"></div>` var instance = yo`<div class="instance ${css.instance}" id="instance${address}"></div>`
var context = executionContext.isVM() ? 'memory' : 'blockchain' var context = self.udapp.context()
var shortAddress = helper.shortenAddress(address) var shortAddress = helper.shortenAddress(address)
var title = yo`<div class="${css.title}" onclick=${toggleClass}> var title = yo`<div class="${css.title}" onclick=${toggleClass}>

@ -184,6 +184,10 @@ UniversalDAppModel.prototype.call = function (isUserAction, args, value, lookupO
}) })
} }
UniversalDAppModel.prototype.context = function () {
return (executionContext.isVM() ? 'memory' : 'blockchain')
}
function execute (pipeline, env, callback) { function execute (pipeline, env, callback) {
function next (err, env) { function next (err, env) {
if (err) return callback(err) if (err) return callback(err)

Loading…
Cancel
Save