Merge pull request #422 from 3esmit/patch-1

Initialize web3 provider before deployAll
This commit is contained in:
Iuri Matias 2018-05-17 15:08:29 -04:00 committed by GitHub
commit a967b304e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,18 +41,27 @@ var Test = function(options) {
});
this.web3 = new Web3();
};
Test.prototype.deployAll = function(contractsConfig, cb) {
var self = this;
if (this.simOptions.node) {
this.web3.setProvider(new this.web3.providers.HttpProvider(this.simOptions.node));
} else {
this.sim = getSimulator();
this.web3.setProvider(this.sim.provider(this.simOptions));
}
};
Test.prototype.getAccounts = function(cb) {
this.web3.eth.getAccounts(function(err, accounts) {
if (err) {
throw new Error(err);
}
cb(accounts);
});
};
Test.prototype.deployAll = function(contractsConfig, cb) {
var self = this;
async.waterfall([
function getConfig(callback) {
let _versions_default = self.engine.config.contractsConfig.versions;