mirror of https://github.com/embarklabs/embark.git
Display info about gas when deploying contract
This commit is contained in:
parent
2f6e96db86
commit
1d71c7fbce
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue