From 3b6251eeb192c1ba229a2ee056f87e28d33b1811 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 21 Sep 2018 17:52:32 -0400 Subject: [PATCH] improve some deployment error messages --- lib/modules/deployment/contract_deployer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/deployment/contract_deployer.js b/lib/modules/deployment/contract_deployer.js index fe41b313..4a8c5ba3 100644 --- a/lib/modules/deployment/contract_deployer.js +++ b/lib/modules/deployment/contract_deployer.js @@ -245,7 +245,7 @@ class ContractDeployer { deployObject = self.blockchain.deployContractObject(contractObject, {arguments: contractParams, data: dataCode}); } catch(e) { if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) { - return next(new Error(__("attempted to deploy %s without specifying parameters", contract.className))); + return next(new Error(__("attempted to deploy %s without specifying parameters", contract.className)) + ". " + __("check if there are any params defined for this contract in this environment in the contracts configuration file")); } return next(new Error(e)); } @@ -267,7 +267,6 @@ class ContractDeployer { let estimatedCost = contract.gas * contract.gasPrice; self.logFunction(contract)(__("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: contract.deploymentAccount, gas: contract.gas, @@ -276,6 +275,9 @@ class ContractDeployer { if (error) { contract.error = error.message; self.events.emit("deploy:contract:error", contract); + if (error.message && error.message.indexOf('replacement transaction underpriced')) { + self.logger.warn("replacement transaction underpriced: This warning typically means a transaction exactly like this one is still pending on the blockchain") + } return next(new Error("error deploying =" + contract.className + "= due to error: " + error.message)); } self.logFunction(contract)(contract.className.bold.cyan + " " + __("deployed at").green + " " + receipt.contractAddress.bold.cyan + " " + __("using").green + " " + receipt.gasUsed + " " + __("gas").green);