|
|
@ -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>` |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|