From 215bb65e4f9aa6e6e31b1672e62cbf2dc1f63474 Mon Sep 17 00:00:00 2001 From: ninabreznik Date: Mon, 11 Dec 2017 23:18:53 +0700 Subject: [PATCH] Add if (node.name === FunctionDefinition) --- src/app/editor/contextView.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/app/editor/contextView.js b/src/app/editor/contextView.js index 4fb8511ae4..56beacaab5 100644 --- a/src/app/editor/contextView.js +++ b/src/app/editor/contextView.js @@ -172,16 +172,17 @@ class ContextView { ` function showGasEstimation () { - var result = self._api.contextualListener.gasEstimation(node) - var executionCost = 'Execution cost: ' + result.executionCost + ' gas' - var codeDepositCost = 'Code deposit cost: ' + result.codeDepositCost + ' gas' - var estimatedGas = result.codeDepositCost ? `${codeDepositCost}, ${executionCost}` : `${executionCost}` - return yo`
+ if (node.name === 'FunctionDefinition') { + var result = self._api.contextualListener.gasEstimation(node) + var executionCost = 'Execution cost: ' + result.executionCost + ' gas' + var codeDepositCost = 'Code deposit cost: ' + result.codeDepositCost + ' gas' + var estimatedGas = result.codeDepositCost ? `${codeDepositCost}, ${executionCost}` : `${executionCost}` + return yo`
${estimatedGas} -
` +
` + } } - } }