diff --git a/lib/modules/blockchain_connector/index.js b/lib/modules/blockchain_connector/index.js index 4ea5e1430..eda9d2463 100644 --- a/lib/modules/blockchain_connector/index.js +++ b/lib/modules/blockchain_connector/index.js @@ -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) { diff --git a/lib/modules/deployment/contract_deployer.js b/lib/modules/deployment/contract_deployer.js index 531b0be6a..384ecf7ac 100644 --- a/lib/modules/deployment/contract_deployer.js +++ b/lib/modules/deployment/contract_deployer.js @@ -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(); }); } diff --git a/lib/modules/deployment/index.js b/lib/modules/deployment/index.js index ebdd97eb9..2b046542c 100644 --- a/lib/modules/deployment/index.js +++ b/lib/modules/deployment/index.js @@ -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); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0deffb49a..8898dd239 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -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", diff --git a/package.json b/package.json index 2fec445d4..bc073259c 100644 --- a/package.json +++ b/package.json @@ -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",