update for constructor encode

pull/3094/head
Rob Stupay 7 years ago
parent 14f4661f56
commit 28f8c40767
  1. 3
      src/app/tabs/run-tab.js
  2. 12
      src/multiParamManager.js

@ -329,9 +329,10 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
createPanel.innerHTML = ''
if (opts.compiler.getContract && selectContractNames.selectedIndex >= 0 && selectContractNames.children.length > 0) {
var ctrabi = txHelper.getConstructorInterface(getSelectedContract().contract.object.abi)
var ctrEVMbc = getSelectedContract().contract.object.evm.bytecode.object
var createConstructorInstance = new MultiParamManager(0, ctrabi, (valArray, inputsValues) => {
createInstance(inputsValues)
}, txHelper.inputParametersDeclarationToString(ctrabi.inputs), 'Deploy')
}, txHelper.inputParametersDeclarationToString(ctrabi.inputs), 'Deploy', ctrEVMbc)
createPanel.appendChild(createConstructorInstance.render())
return
} else {

@ -15,14 +15,16 @@ class MultiParamManager {
* @param {Function} clickMultiCallBack
* @param {string} inputs
* @param {string} title
* @param {string} evmBC
*
*/
constructor (lookupOnly, funABI, clickCallBack, inputs, title) {
constructor (lookupOnly, funABI, clickCallBack, inputs, title, evmBC) {
this.lookupOnly = lookupOnly
this.funABI = funABI
this.clickCallBack = clickCallBack
this.inputs = inputs
this.title = title
this.evmBC = evmBC
this.basicInputField
this.multiFields
}
@ -154,7 +156,13 @@ class MultiParamManager {
() => {
var multiString = this.getMultiValsString()
var multiJSON = JSON.parse('[' + multiString + ']')
var encodeObj = txFormat.encodeData(this.funABI, multiJSON)
var encodeObj
if (this.evmBC) {
console.log(this.evmBC)
encodeObj = txFormat.encodeData(this.funABI, multiJSON, this.evmBC)
} else {
encodeObj = txFormat.encodeData(this.funABI, multiJSON)
}
if (encodeObj.error) {
return encodeObj.error
} else {

Loading…
Cancel
Save