mirror of https://github.com/embarklabs/embark.git
move - for now - determining gas price to deployment to avoid race conditions
This commit is contained in:
parent
296663edc7
commit
d0162a6c78
|
@ -199,6 +199,13 @@ class ContractDeployer {
|
|||
function applyBeforeDeploy(next) {
|
||||
self.plugins.emitAndRunActionsForEvent('deploy:contract:beforeDeploy', {contract: contract}, next);
|
||||
},
|
||||
function getGasPriceForNetwork(next) {
|
||||
self.events.request("blockchain:gasPrice", (gasPrice) => {
|
||||
console.dir('[contracts/contracts]: got gasPrice of ' + gasPrice);
|
||||
contract.gasPrice = contract.gasPrice || gasPrice;
|
||||
next();
|
||||
});
|
||||
},
|
||||
function createDeployObject(next) {
|
||||
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
||||
|
||||
|
|
|
@ -95,13 +95,7 @@ class ContractsManager {
|
|||
},
|
||||
function getGasPriceForNetwork(callback) {
|
||||
console.dir('[contracts/contracts]: gas price for network, passed in gasPrice from config: ' + self.contractsConfig.gasPrice);
|
||||
if (self.contractsConfig.gasPrice) {
|
||||
return callback(null, self.contractsConfig.gasPrice);
|
||||
}
|
||||
self.events.request("blockchain:gasPrice", (gasprice) => {
|
||||
console.dir('[contracts/contracts]: got gasPrice of ' + gasprice);
|
||||
callback(null, gasprice);
|
||||
});
|
||||
return callback(null, self.contractsConfig.gasPrice);
|
||||
},
|
||||
function prepareContractsFromCompilation(gasPrice, callback) {
|
||||
console.dir('[contracts/contracts]: using gasprice ' + gasPrice + ', prepare contracts from compilation');
|
||||
|
|
Loading…
Reference in New Issue