remove execution tx-helper from UI

pull/1/head
Iuri Matias 7 years ago
parent 8f49c8fbd7
commit e5b1df0744
  1. 12
      src/universal-dapp-ui.js
  2. 17
      src/universal-dapp.js

@ -2,14 +2,13 @@
'use strict'
var $ = require('jquery')
var remixLib = require('remix-lib')
var yo = require('yo-yo')
var txHelper = require('./app/execution/txHelper')
var helper = require('./lib/helper')
var copyToClipboard = require('./app/ui/copy-to-clipboard')
// -------------- styling ----------------------
var csjs = require('csjs-inject')
var remixLib = require('remix-lib')
var styleGuide = remixLib.ui.themeChooser
var styles = styleGuide.chooser()
@ -155,7 +154,7 @@ UniversalDAppUI.prototype.reset = function (contracts, transactionContextAPI) {
}
UniversalDAppUI.prototype.renderInstance = function (contract, address, contractName) {
var abi = txHelper.sortAbiFunction(contract.abi)
var abi = this.udapp.getABI(contract)
return this.renderInstanceFromABI(abi, address, contractName)
}
@ -190,7 +189,7 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
instance.appendChild(title)
// Add the fallback function
var fallback = txHelper.getFallbackInterface(contractABI)
var fallback = self.udapp.getFallbackInterface(contractABI)
if (fallback) {
instance.appendChild(this.getCallButton({
funABI: fallback,
@ -224,10 +223,7 @@ UniversalDAppUI.prototype.getCallButton = function (args) {
// args.contractName [constr only]
var lookupOnly = args.funABI.constant
var inputs = ''
if (args.funABI.inputs) {
inputs = txHelper.inputParametersDeclarationToString(args.funABI.inputs)
}
var inputs = self.udapp.getInputs(args.funABI)
var inputField = yo`<input></input>`
inputField.setAttribute('placeholder', inputs)
inputField.setAttribute('title', inputs)

@ -8,7 +8,7 @@ var EventManager = remixLib.EventManager
var crypto = require('crypto')
var TxRunner = require('./app/execution/txRunner')
var txFormat = require('./app/execution/txFormat')
// var txHelper = require('./app/execution/txHelper')
var txHelper = require('./app/execution/txHelper')
var txExecution = require('./app/execution/txExecution')
var executionContext = require('./execution-context')
var modalCustom = require('./app/ui/modal-dialog-custom')
@ -187,6 +187,21 @@ UniversalDAppModel.prototype.context = function () {
return (executionContext.isVM() ? 'memory' : 'blockchain')
}
UniversalDAppModel.prototype.getABI = function (contract) {
return txHelper.sortAbiFunction(contract.abi)
}
UniversalDAppModel.prototype.getFallbackInterface = function (contractABI) {
return txHelper.getFallbackInterface(contractABI)
}
UniversalDAppModel.prototype.getInputs = function (funABI) {
if (!funABI.inputs) {
return ''
}
return txHelper.inputParametersDeclarationToString(funABI.inputs)
}
function execute (pipeline, env, callback) {
function next (err, env) {
if (err) return callback(err)

Loading…
Cancel
Save