From 53d897f99ba73ad950fd27ec72ece8bdc4b0116f Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 30 Nov 2017 13:27:39 +0100 Subject: [PATCH] add renderInstanceFromABI --- src/universal-dapp.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index 450d39204e..04dba18e95 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -277,7 +277,7 @@ UniversalDApp.prototype.getBalance = function (address, cb) { } UniversalDApp.prototype.renderInstance = function (contract, address, contractName) { - var abi = txHelper.sortAbiFunction(contract.abi) + var abi = txHelper.sortAbiFunction(contract) return this.renderInstanceFromABI(abi, address, contractName) } @@ -309,22 +309,20 @@ UniversalDApp.prototype.renderInstanceFromABI = function (contractABI, address, $(instance).toggleClass(`${css.hidesub}`) } - var abi = txHelper.sortAbiFunction(contractABI) - instance.appendChild(title) // Add the fallback function - var fallback = txHelper.getFallbackInterface(abi) + var fallback = txHelper.getFallbackInterface(contractABI) if (fallback) { instance.appendChild(this.getCallButton({ funABI: fallback, address: address, - contractAbi: abi, + contractAbi: contractABI, contractName: contractName })) } - $.each(abi, (i, funABI) => { + $.each(contractABI, (i, funABI) => { if (funABI.type !== 'function') { return } @@ -332,7 +330,7 @@ UniversalDApp.prototype.renderInstanceFromABI = function (contractABI, address, instance.appendChild(this.getCallButton({ funABI: funABI, address: address, - contractAbi: abi, + contractAbi: contractABI, contractName: contractName })) })