mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-25 11:55:47 +00:00
Merge pull request #422 from 3esmit/patch-1
Initialize web3 provider before deployAll
This commit is contained in:
commit
a967b304e3
@ -41,10 +41,6 @@ var Test = function(options) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.web3 = new Web3();
|
this.web3 = new Web3();
|
||||||
};
|
|
||||||
|
|
||||||
Test.prototype.deployAll = function(contractsConfig, cb) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
if (this.simOptions.node) {
|
if (this.simOptions.node) {
|
||||||
this.web3.setProvider(new this.web3.providers.HttpProvider(this.simOptions.node));
|
this.web3.setProvider(new this.web3.providers.HttpProvider(this.simOptions.node));
|
||||||
@ -52,6 +48,19 @@ Test.prototype.deployAll = function(contractsConfig, cb) {
|
|||||||
this.sim = getSimulator();
|
this.sim = getSimulator();
|
||||||
this.web3.setProvider(this.sim.provider(this.simOptions));
|
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([
|
async.waterfall([
|
||||||
function getConfig(callback) {
|
function getConfig(callback) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user