diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index 9d8e32e110..bc887f7399 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -73,11 +73,11 @@ module.exports = { if (bytecode.indexOf('_') < 0) { return callback(null, bytecode) } - var m = bytecode.match(/__([^_]{1,36})__/) - if (!m) { + var libraryRefMatch = bytecode.match(/__([^_]{1,36})__/) + if (!libraryRefMatch) { return callback('Invalid bytecode format.') } - var libraryName = m[1] + var libraryName = libraryRefMatch[1] var libraryabi = helper.getContractByName(libraryName, contracts) if (!libraryabi) { return callback('Library ' + libraryName + ' not found.') diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index 708742b286..f36296f390 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -359,18 +359,17 @@ function compileTab (container, appAPI, appEvents, opts) { var select = el.querySelector('select') if (select.children.length > 0 && select.selectedIndex >= 0) { var contractName = select.children[select.selectedIndex].innerHTML - var details = contractsDetails[contractName] - var keys = Object.keys(contractsDetails[contractName]) + var contractProperties = contractsDetails[contractName] var log = yo`
` - keys.map(x => { - var copyDetails = yo` { copy(details[x]) }} aria-hidden="true">` - var questionMark = yo`` + Object.keys(contractProperties).map(propertyName => { + var copyDetails = yo` { copy(contractProperties[propertyName]) }} aria-hidden="true">` + var questionMark = yo`` var keyDisplayName - (x === 'interface') ? keyDisplayName = 'interface - abi' : keyDisplayName = x + (propertyName === 'interface') ? keyDisplayName = 'interface - abi' : keyDisplayName = propertyName log.appendChild(yo`${details[x]}` - } else if (x === 'interface' || x === 'metadata') { + if (propertyName === 'bytecode' || propertyName === 'metadataHash' || propertyName === 'swarmLocation' || propertyName === 'Runtime Bytecode' || propertyName === 'Opcodes') { + node = yo`
${details[propertyName]}` + } else if (propertyName === 'interface' || propertyName === 'metadata') { var treeView = new TreeView({ extractData: function (item, parent, key) { var ret = {} @@ -406,17 +405,17 @@ function compileTab (container, appAPI, appEvents, opts) { return ret } }) - if (details[x] !== '') { + if (details[propertyName] !== '') { try { - node = yo`