From a68d401bc1c3d1909e7e37765fdd8a33d14cf43d 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 bd771eb2be..cb37e0103c 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} -
` +
` + } } - } }