From 250318433723b9a89b67097134a37466f20da195 Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 6 Apr 2021 13:54:32 +0200 Subject: [PATCH] writting - for undefined values of gas estimation --- apps/remix-ide/src/app/editor/contextualListener.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/app/editor/contextualListener.js b/apps/remix-ide/src/app/editor/contextualListener.js index 3f748d6b54..ab75e5855e 100644 --- a/apps/remix-ide/src/app/editor/contextualListener.js +++ b/apps/remix-ide/src/app/editor/contextualListener.js @@ -195,9 +195,9 @@ class ContextualListener extends Plugin { const fnName = node.name const fn = fnName + this._getInputParams(node) if (visibility === 'public' || visibility === 'external') { - executionCost = this.estimationObj.external[fn] + executionCost = this.estimationObj === null ? '-' : this.estimationObj.external[fn] } else if (visibility === 'private' || visibility === 'internal') { - executionCost = this.estimationObj.internal[fn] + executionCost = this.estimationObj === null ? '-' : this.estimationObj.internal[fn] } } else { executionCost = this.creationCost @@ -215,8 +215,8 @@ class ContextualListener extends Plugin { const contract = this.nodes[i] this.contract = this.results.data.contracts[this.results.source.target][contract.name] this.estimationObj = this.contract.evm.gasEstimates - this.creationCost = this.estimationObj === null ? '' : this.estimationObj.creation.totalCost - this.codeDepositCost = this.estimationObj === null ? '' : this.estimationObj.creation.codeDepositCost + this.creationCost = this.estimationObj === null ? '-' : this.estimationObj.creation.totalCost + this.codeDepositCost = this.estimationObj === null ? '-' : this.estimationObj.creation.codeDepositCost } } }