mirror of https://github.com/embarklabs/embark.git
stop provider when reseting providers
This commit is contained in:
parent
9fb19ed78b
commit
1e36950e24
|
@ -44,6 +44,9 @@ class Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
initWeb3Provider(callback) {
|
initWeb3Provider(callback) {
|
||||||
|
if (this.provider) {
|
||||||
|
this.provider.stop();
|
||||||
|
}
|
||||||
if (this.simOptions.host) {
|
if (this.simOptions.host) {
|
||||||
let {host, port, type, protocol, accounts} = this.simOptions;
|
let {host, port, type, protocol, accounts} = this.simOptions;
|
||||||
if (!protocol) {
|
if (!protocol) {
|
||||||
|
@ -75,7 +78,9 @@ class Test {
|
||||||
return {balance: account.hexBalance, secretKey: account.privateKey};
|
return {balance: account.hexBalance, secretKey: account.privateKey};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.sim = getSimulator();
|
if (!this.sim) {
|
||||||
|
this.sim = getSimulator();
|
||||||
|
}
|
||||||
this.web3.setProvider(this.sim.provider(this.simOptions));
|
this.web3.setProvider(this.sim.provider(this.simOptions));
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue