From bcb185ddddf3b5d9051d0bbd9861e5f08cdd240e Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 28 Jul 2016 17:54:01 +0100 Subject: [PATCH] Display abstract contracts, but don't let them to be instantiated --- src/universal-dapp.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index a68e702df7..4a1c9c8e7e 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -152,12 +152,6 @@ UniversalDApp.prototype.render = function () { self.$el.append(self.getABIInputForm()); } else { for (var c in self.contracts) { - // This is an abstract contract. Do not display. - // FIXME: maybe have a flag for this in the JSON? - if (self.contracts[c].bytecode.length === 0) { - continue; - } - var $contractEl = $('
'); if (self.contracts[c].address) { @@ -167,7 +161,13 @@ UniversalDApp.prototype.render = function () { if (self.contracts[c].bytecode) { $title.append($('
').text((self.contracts[c].bytecode.length / 2) + ' bytes')); } - $contractEl.append($title).append(self.getCreateInterface($contractEl, self.contracts[c])); + $contractEl.append($title); + + // Only display creation interface for non-abstract contracts. + // FIXME: maybe have a flag for this in the JSON? + if (self.contracts[c].bytecode.length !== 0) { + $contractEl.append(self.getCreateInterface($contractEl, self.contracts[c])); + } } self.$el.append(self.renderOutputModifier(self.contracts[c].name, $contractEl)); }