Commit daaddd48 authored by ninabreznik's avatar ninabreznik

Add if (node.name === FunctionDefinition)

parent d9c50a8e
...@@ -172,16 +172,17 @@ class ContextView { ...@@ -172,16 +172,17 @@ class ContextView {
</div>` </div>`
function showGasEstimation () { function showGasEstimation () {
var result = self._api.contextualListener.gasEstimation(node) if (node.name === 'FunctionDefinition') {
var executionCost = 'Execution cost: ' + result.executionCost + ' gas' var result = self._api.contextualListener.gasEstimation(node)
var codeDepositCost = 'Code deposit cost: ' + result.codeDepositCost + ' gas' var executionCost = 'Execution cost: ' + result.executionCost + ' gas'
var estimatedGas = result.codeDepositCost ? `${codeDepositCost}, ${executionCost}` : `${executionCost}` var codeDepositCost = 'Code deposit cost: ' + result.codeDepositCost + ' gas'
return yo`<div class=${css.gasEstimation}> var estimatedGas = result.codeDepositCost ? `${codeDepositCost}, ${executionCost}` : `${executionCost}`
return yo`<div class=${css.gasEstimation}>
<img class=${css.gasStationIcon} title='Gas estimation' src='assets/img/gasStation_50.png'> <img class=${css.gasStationIcon} title='Gas estimation' src='assets/img/gasStation_50.png'>
${estimatedGas} ${estimatedGas}
</div>` </div>`
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment