writting - for undefined values of gas estimation

pull/1106/head
lianahus 4 years ago committed by Liana Husikyan
parent 4b454c1888
commit 2503184337
  1. 8
      apps/remix-ide/src/app/editor/contextualListener.js

@ -195,9 +195,9 @@ class ContextualListener extends Plugin {
const fnName = node.name const fnName = node.name
const fn = fnName + this._getInputParams(node) const fn = fnName + this._getInputParams(node)
if (visibility === 'public' || visibility === 'external') { if (visibility === 'public' || visibility === 'external') {
executionCost = this.estimationObj.external[fn] executionCost = this.estimationObj === null ? '-' : this.estimationObj.external[fn]
} else if (visibility === 'private' || visibility === 'internal') { } else if (visibility === 'private' || visibility === 'internal') {
executionCost = this.estimationObj.internal[fn] executionCost = this.estimationObj === null ? '-' : this.estimationObj.internal[fn]
} }
} else { } else {
executionCost = this.creationCost executionCost = this.creationCost
@ -215,8 +215,8 @@ class ContextualListener extends Plugin {
const contract = this.nodes[i] const contract = this.nodes[i]
this.contract = this.results.data.contracts[this.results.source.target][contract.name] this.contract = this.results.data.contracts[this.results.source.target][contract.name]
this.estimationObj = this.contract.evm.gasEstimates this.estimationObj = this.contract.evm.gasEstimates
this.creationCost = this.estimationObj === null ? '<not applicable>' : this.estimationObj.creation.totalCost this.creationCost = this.estimationObj === null ? '-' : this.estimationObj.creation.totalCost
this.codeDepositCost = this.estimationObj === null ? '<not applicable>' : this.estimationObj.creation.codeDepositCost this.codeDepositCost = this.estimationObj === null ? '-' : this.estimationObj.creation.codeDepositCost
} }
} }
} }

Loading…
Cancel
Save