mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-11 14:34:40 +00:00
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) {
|
function applyBeforeDeploy(next) {
|
||||||
self.plugins.emitAndRunActionsForEvent('deploy:contract:beforeDeploy', {contract: contract}, 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) {
|
function createDeployObject(next) {
|
||||||
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
let contractObject = self.blockchain.ContractObject({abi: contract.abiDefinition});
|
||||||
|
|
||||||
|
@ -95,13 +95,7 @@ class ContractsManager {
|
|||||||
},
|
},
|
||||||
function getGasPriceForNetwork(callback) {
|
function getGasPriceForNetwork(callback) {
|
||||||
console.dir('[contracts/contracts]: gas price for network, passed in gasPrice from config: ' + self.contractsConfig.gasPrice);
|
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);
|
||||||
return callback(null, self.contractsConfig.gasPrice);
|
|
||||||
}
|
|
||||||
self.events.request("blockchain:gasPrice", (gasprice) => {
|
|
||||||
console.dir('[contracts/contracts]: got gasPrice of ' + gasprice);
|
|
||||||
callback(null, gasprice);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
function prepareContractsFromCompilation(gasPrice, callback) {
|
function prepareContractsFromCompilation(gasPrice, callback) {
|
||||||
console.dir('[contracts/contracts]: using gasprice ' + gasPrice + ', prepare contracts from compilation');
|
console.dir('[contracts/contracts]: using gasprice ' + gasPrice + ', prepare contracts from compilation');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user