mirror of https://github.com/embarklabs/embark.git
commit
69894d2e06
|
@ -20,7 +20,6 @@ class BlockchainConnector {
|
|||
this.isDev = options.isDev;
|
||||
this.web3Endpoint = '';
|
||||
this.isWeb3Ready = false;
|
||||
this.deployers = {};
|
||||
|
||||
self.events.setCommandHandler("blockchain:web3:isReady", (cb) => {
|
||||
cb(self.isWeb3Ready);
|
||||
|
@ -233,29 +232,9 @@ class BlockchainConnector {
|
|||
}
|
||||
|
||||
deployContractFromObject(deployContractObject, params, cb) {
|
||||
let deployer = this.deployers[deployContractObject._deployData];
|
||||
|
||||
if (!deployer) {
|
||||
deployer = {running: false, requested: []};
|
||||
this.deployers[deployContractObject._deployData] = deployer;
|
||||
}
|
||||
|
||||
if (deployer.running) {
|
||||
deployer.requested.push({deployContractObject, params, cb});
|
||||
return;
|
||||
}
|
||||
|
||||
deployer.running = true;
|
||||
embarkJsUtils.secureSend(this.web3, deployContractObject, {
|
||||
from: params.from, gas: params.gas, gasPrice: params.gasPrice
|
||||
}, true, (error, receipt) => {
|
||||
deployer.running = false;
|
||||
if (deployer.requested.length > 0) {
|
||||
let request = deployer.requested.shift();
|
||||
this.deployContractFromObject(request.deployContractObject, request.params, request.cb);
|
||||
}
|
||||
cb(error, receipt);
|
||||
});
|
||||
}, true, cb);
|
||||
}
|
||||
|
||||
determineDefaultAccount(cb) {
|
||||
|
|
|
@ -257,7 +257,8 @@ class ContractDeployer {
|
|||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
contract.gas = gasValue;
|
||||
let increase_per = 1 + (Math.random() / 10.0);
|
||||
contract.gas = Math.floor(gasValue * increase_per);
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ class DeployManager {
|
|||
});
|
||||
|
||||
try {
|
||||
async.auto(contractDeploys, function(_err, _results) {
|
||||
async.auto(contractDeploys, 1, function(_err, _results) {
|
||||
if (errors.length) {
|
||||
_err = __("Error deploying contracts. Please fix errors to continue.");
|
||||
self.logger.error(_err);
|
||||
|
|
|
@ -2915,9 +2915,9 @@
|
|||
}
|
||||
},
|
||||
"embarkjs": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/embarkjs/-/embarkjs-0.4.2.tgz",
|
||||
"integrity": "sha512-PSSs2WHxq8SkeHku56GZwRYsJDRjKYjRCQj7XItD/11lzlqSxOoymrnmZBkCGORBOil93n9MFhMMjsiAepEyVg==",
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/embarkjs/-/embarkjs-0.4.3.tgz",
|
||||
"integrity": "sha512-0y50RSywW3ehPR5lOd0t+p+Xq8ycjHVbHFLU+9PwaS2nBDi4JU/BF0JYly3hUZp0cQmkmfTJDsnub/Ys/95Mcg==",
|
||||
"requires": {
|
||||
"@babel/runtime-corejs2": "7.0.0-rc.1",
|
||||
"async": "2.6.1",
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"decompress": "4.2.0",
|
||||
"deep-equal": "1.0.1",
|
||||
"ejs": "2.6.1",
|
||||
"embarkjs": "0.4.2",
|
||||
"embarkjs": "0.4.3",
|
||||
"eth-ens-namehash": "2.0.8",
|
||||
"eth-lib": "0.2.8",
|
||||
"ethereumjs-wallet": "0.6.0",
|
||||
|
|
Loading…
Reference in New Issue