mirror of https://github.com/embarklabs/embark.git
improve some deployment error messages
This commit is contained in:
parent
4af9114681
commit
3b6251eeb1
|
@ -245,7 +245,7 @@ class ContractDeployer {
|
||||||
deployObject = self.blockchain.deployContractObject(contractObject, {arguments: contractParams, data: dataCode});
|
deployObject = self.blockchain.deployContractObject(contractObject, {arguments: contractParams, data: dataCode});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) {
|
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));
|
return next(new Error(e));
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,6 @@ class ContractDeployer {
|
||||||
let estimatedCost = contract.gas * contract.gasPrice;
|
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.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, {
|
self.blockchain.deployContractFromObject(deployObject, {
|
||||||
from: contract.deploymentAccount,
|
from: contract.deploymentAccount,
|
||||||
gas: contract.gas,
|
gas: contract.gas,
|
||||||
|
@ -276,6 +275,9 @@ class ContractDeployer {
|
||||||
if (error) {
|
if (error) {
|
||||||
contract.error = error.message;
|
contract.error = error.message;
|
||||||
self.events.emit("deploy:contract:error", contract);
|
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));
|
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);
|
self.logFunction(contract)(contract.className.bold.cyan + " " + __("deployed at").green + " " + receipt.contractAddress.bold.cyan + " " + __("using").green + " " + receipt.gasUsed + " " + __("gas").green);
|
||||||
|
|
Loading…
Reference in New Issue