mirror of https://github.com/embarklabs/embark.git
Reset account
This commit is contained in:
parent
7aae8bc798
commit
24aecc553b
|
@ -51,6 +51,16 @@ class Test {
|
||||||
if (this.provider) {
|
if (this.provider) {
|
||||||
this.provider.stop();
|
this.provider.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.simOptions.accounts) {
|
||||||
|
this.simOptions.accounts = this.simOptions.accounts.map((account) => {
|
||||||
|
if (!account.hexBalance) {
|
||||||
|
account.hexBalance = '0x8AC7230489E80000'; // 10 ether
|
||||||
|
}
|
||||||
|
return {balance: account.hexBalance, secretKey: account.privateKey};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
@ -84,14 +94,6 @@ class Test {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.simOptions.accounts) {
|
|
||||||
this.simOptions.accounts = this.simOptions.accounts.map((account) => {
|
|
||||||
if (!account.hexBalance) {
|
|
||||||
account.hexBalance = '0x8AC7230489E80000'; // 10 ether
|
|
||||||
}
|
|
||||||
return {balance: account.hexBalance, secretKey: account.privateKey};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!this.sim) {
|
if (!this.sim) {
|
||||||
this.sim = getSimulator();
|
this.sim = getSimulator();
|
||||||
}
|
}
|
||||||
|
@ -189,7 +191,10 @@ class Test {
|
||||||
}
|
}
|
||||||
if (accounts) {
|
if (accounts) {
|
||||||
self.simOptions.accounts = AccountParser.parseAccountsConfig(accounts, self.web3);
|
self.simOptions.accounts = AccountParser.parseAccountsConfig(accounts, self.web3);
|
||||||
|
} else {
|
||||||
|
self.simOptions.account = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(self.simOptions, {
|
Object.assign(self.simOptions, {
|
||||||
host,
|
host,
|
||||||
port,
|
port,
|
||||||
|
|
Loading…
Reference in New Issue