feat(@embark/deployment): output transaction hash during deployment asap

This commit is contained in:
Pascal Precht 2018-11-21 11:49:00 +01:00 committed by Iuri Matias
parent 3099894ed7
commit 0bb7d6352c
2 changed files with 4 additions and 3 deletions

View File

@ -643,10 +643,10 @@ class BlockchainConnector {
}).catch(cb);
}
deployContractFromObject(deployContractObject, params, cb) {
deployContractFromObject(deployContractObject, params, cb, hashCb) {
embarkJsUtils.secureSend(this.web3, deployContractObject, {
from: params.from, gas: params.gas, gasPrice: params.gasPrice
}, true, cb);
}, true, cb, hashCb);
}
determineDefaultAccount(cb) {

View File

@ -282,7 +282,6 @@ class ContractDeployer {
},
function deployTheContract(next) {
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,
@ -311,6 +310,8 @@ class ContractDeployer {
return next(null, receipt);
});
});
}, hash => {
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 + " (txHash: " + hash.bold.cyan + ")");
});
}
], callback);