enable comma separated keys in file

This commit is contained in:
Jonathan Rainville 2018-05-14 13:30:13 -04:00
parent 24c4c51232
commit e470a63905
1 changed files with 4 additions and 1 deletions

View File

@ -60,7 +60,10 @@ class Provider {
}
if (accountConfig.privateKeyFile) {
let fileContent = fs.readFileSync(fs.dappPath(accountConfig.privateKeyFile)).toString();
return this.web3.eth.accounts.privateKeyToAccount(fileContent.trim());
fileContent = fileContent.trim().split(/[,;]/);
return fileContent.map(key => {
return this.web3.eth.accounts.privateKeyToAccount(key);
});
}
if (accountConfig.mnemonic) {
const hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(accountConfig.mnemonic.trim()));