From 1f32c285afb55c79080199e354cf6581e2873699 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 1 Jun 2015 16:59:08 +0200 Subject: [PATCH] Compiler update to 481e1f20 and added gas estimates. --- index.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 1a951a6e82..72e85071cb 100644 --- a/index.html +++ b/index.html @@ -56,7 +56,7 @@ body { Source code on the left, compiled code and AST on the right (or error).
Note: Chrome/Chromium currently reports "Uncaught JavaScript Exception". To work around this problem, enable the debug console (Ctrl+Shift+i) and reload.
-Version: dea8d55f... 2015-05-18 +Version: 481e1f... 2015-06-01
@@ -197,12 +197,27 @@ var getDetails = function(contract, source) { funHashes += contract.functionHashes[fun] + ' ' + fun + '\n'; details.append($('Functions')); details.append($('
').text(funHashes));
+    details.append($('Gas Estimates'));
+    details.append($('
').text(formatGasEstimates(contract.gasEstimates)));
     details.append($('Assembly'));
     var assembly = $('
').text(formatAssemblyText(contract.assembly, '', source));
     details.append(assembly);
     button.click(function() { details.toggle(); });
     return $('
').append(button).append(details); }; +var formatGasEstimates = function(data) { + var gasToText = function(g) { return g === null ? 'unknown' : g; } + var text = ''; + if ('creation' in data) + text += 'Creation: ' + gasToText(data.creation[0]) + ' + ' + gasToText(data.creation[1]) + '\n'; + text += 'External:\n'; + for (var fun in data.external) + text += ' ' + fun + ': ' + gasToText(data.external[fun]) + '\n'; + text += 'Internal:\n'; + for (var fun in data.internal) + text += ' ' + fun + ': ' + gasToText(data.external[fun]) + '\n'; + return text; +}; var formatAssemblyText = function(asm, prefix, source) { var text = ''; text += prefix + '.code\n';