Commit 1efa6b33 authored by Alex Beregszaszi's avatar Alex Beregszaszi

Do not show bytecode, interface or opcodes if they are empty

parent 5e367b54
...@@ -74,12 +74,17 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) { ...@@ -74,12 +74,17 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
removable_instances: true, removable_instances: true,
renderOutputModifier: function (contractName, $contractOutput) { renderOutputModifier: function (contractName, $contractOutput) {
var contract = data.contracts[contractName]; var contract = data.contracts[contractName];
return $contractOutput if (contract.bytecode) {
.append(textRow('Bytecode', contract.bytecode)) $contractOutput.append(textRow('Bytecode', contract.bytecode));
.append(textRow('Interface', contract['interface'])) }
.append(textRow('Web3 deploy', gethDeploy(contractName.toLowerCase(), contract['interface'], contract.bytecode), 'deploy')) if (contract['interface'] !== '[]\n') {
.append(textRow('uDApp', combined(contractName, contract['interface'], contract.bytecode), 'deploy')) $contractOutput.append(textRow('Interface', contract['interface']));
.append(getDetails(contract, source, contractName)); }
if (contract.bytecode) {
$contractOutput.append(textRow('Web3 deploy', gethDeploy(contractName.toLowerCase(), contract['interface'], contract.bytecode), 'deploy'));
$contractOutput.append(textRow('uDApp', combined(contractName, contract['interface'], contract.bytecode), 'deploy'));
}
return $contractOutput.append(getDetails(contract, source, contractName));
} }
}, transactionDebugger); }, transactionDebugger);
...@@ -129,8 +134,10 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) { ...@@ -129,8 +134,10 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
var getDetails = function (contract, source, contractName) { var getDetails = function (contract, source, contractName) {
var button = $('<button>Toggle Details</button>'); var button = $('<button>Toggle Details</button>');
var details = $('<div style="display: none;"/>') var details = $('<div style="display: none;"/>')
.append(tableRow('Solidity Interface', contract.solidity_interface)) .append(tableRow('Solidity Interface', contract.solidity_interface));
.append(tableRow('Opcodes', contract.opcodes)); if (contract.opcodes !== '') {
details.append(tableRow('Opcodes', contract.opcodes));
}
var funHashes = ''; var funHashes = '';
for (var fun in contract.functionHashes) { for (var fun in contract.functionHashes) {
funHashes += contract.functionHashes[fun] + ' ' + fun + '\n'; funHashes += contract.functionHashes[fun] + ' ' + fun + '\n';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment