Commit 396abd2b authored by Alex Beregszaszi's avatar Alex Beregszaszi

Do not show empty gasEstimates

parent 1efa6b33
...@@ -144,8 +144,11 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) { ...@@ -144,8 +144,11 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
} }
details.append($('<span class="col1">Functions</span>')); details.append($('<span class="col1">Functions</span>'));
details.append($('<pre/>').text(funHashes)); details.append($('<pre/>').text(funHashes));
details.append($('<span class="col1">Gas Estimates</span>')); var gasEstimates = formatGasEstimates(contract.gasEstimates);
details.append($('<pre/>').text(formatGasEstimates(contract.gasEstimates))); if (gasEstimates) {
details.append($('<span class="col1">Gas Estimates</span>'));
details.append($('<pre/>').text(gasEstimates));
}
if (contract.runtimeBytecode && contract.runtimeBytecode.length > 0) { if (contract.runtimeBytecode && contract.runtimeBytecode.length > 0) {
details.append(tableRow('Runtime Bytecode', contract.runtimeBytecode)); details.append(tableRow('Runtime Bytecode', contract.runtimeBytecode));
} }
...@@ -162,6 +165,10 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) { ...@@ -162,6 +165,10 @@ function Renderer (editor, executionContext, updateFiles, transactionDebugger) {
}; };
var formatGasEstimates = function (data) { var formatGasEstimates = function (data) {
// FIXME: the whole gasEstimates object should be nil instead
if (data.creation === undefined && data.external === undefined && data.internal === undefined) {
return;
}
var gasToText = function (g) { return g === null ? 'unknown' : g; }; var gasToText = function (g) { return g === null ? 'unknown' : g; };
var text = ''; var text = '';
var fun; var fun;
......
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