From 27f4eb61248907f773a7400716662db0e9b4dcb4 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 23 Jul 2015 22:42:44 +0200 Subject: [PATCH] Cope with interface-only contracts. --- index.html | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index 4b130f1dcb..74811444de 100644 --- a/index.html +++ b/index.html @@ -243,10 +243,13 @@ var renderContracts = function(data, source) { for (var contractName in data.contracts) { var contract = data.contracts[contractName]; var contractOutput = $('
') - .append($('

').text(contractName)) - .append($('
').text((contract.bytecode.length / 2) + ' bytes')) - .append(getExecuteInterface(contract, contractName)) - .append(tableRow('Bytecode', contract.bytecode)) + .append($('

').text(contractName)); + if (contract.bytecode.length > 0) + contractOutput + .append($('
').text((contract.bytecode.length / 2) + ' bytes')) + .append(getExecuteInterface(contract, contractName)) + .append(tableRow('Bytecode', contract.bytecode)); + contractOutput .append(tableRow('Interface', contract['interface'])) .append(textRow('Geth deploy', gethDeploy(contractName.toLowerCase(),contract['interface'],contract.bytecode))) .append(getDetails(contract, source, contractName)); @@ -281,9 +284,12 @@ var getDetails = function(contract, source, contractName) { 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);
+    if (contract.assembly !== null)
+    {
+        details.append($('Assembly'));
+        var assembly = $('
').text(formatAssemblyText(contract.assembly, '', source));
+        details.append(assembly);
+    }
     button.click(function() { detailsOpen[contractName] = !detailsOpen[contractName]; details.toggle(); });
     if (detailsOpen[contractName])
         details.show();