mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-21 04:38:49 +00:00
Merge pull request #640 from embark-framework/feature/log-gas-info
Display info about gas when deploying contract
This commit is contained in:
commit
444c504061
@ -227,7 +227,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,
|
||||
@ -239,7 +240,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…
x
Reference in New Issue
Block a user