From 1d71c7fbceff9d780a9a3465b3f03549b08ba919 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Wed, 25 Jul 2018 13:27:15 +0100 Subject: [PATCH] Display info about gas when deploying contract --- lib/contracts/contract_deployer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/contracts/contract_deployer.js b/lib/contracts/contract_deployer.js index 7da3d35ed..b0774a33b 100644 --- a/lib/contracts/contract_deployer.js +++ b/lib/contracts/contract_deployer.js @@ -233,7 +233,8 @@ class ContractDeployer { next(); }, function deployTheContract(next) { - self.logger.info(__("deploying") + " " + contract.className.bold.cyan + " " + __("with").green + " " + contract.gas + " " + __("gas").green); + let estimatedCost = contract.gas * contract.gasPrice; + self.logger.info(__("deploying") + " " + contract.className.bold.cyan + " " + __("with").green + " " + contract.gas + " " + __("gas at the price of").green + " " + contract.gasPrice + " " + __("Wei, estimated cost:").green + " " + estimatedCost + " Wei".green); self.blockchain.deployContractFromObject(deployObject, { from: deploymentAccount, @@ -245,7 +246,7 @@ class ContractDeployer { self.events.emit("deploy:contract:error", contract); return next(new Error("error deploying =" + contract.className + "= due to error: " + error.message)); } - self.logger.info(contract.className.bold.cyan + " " + __("deployed at").green + " " + receipt.contractAddress.bold.cyan); + self.logger.info(contract.className.bold.cyan + " " + __("deployed at").green + " " + receipt.contractAddress.bold.cyan + " " + __("using").green + " " + receipt.gasUsed + " " + __("gas").green); contract.deployedAddress = receipt.contractAddress; contract.transactionHash = receipt.transactionHash; receipt.className = contract.className;