Merge pull request #916 from embark-framework/infura_fix

Infura fix
This commit is contained in:
Iuri Matias 2018-09-26 19:04:26 -04:00 committed by GitHub
commit 69894d2e06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 28 deletions

View File

@ -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) {

View File

@ -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();
});
}

View File

@ -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);

6
npm-shrinkwrap.json generated
View File

@ -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",

View File

@ -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",