fix(embark/simulator): fix account object empty when no mnemonic

This commit is contained in:
Jonathan Rainville 2019-04-16 15:48:22 -04:00 committed by Iuri Matias
parent bfebb3ce41
commit a4f68cb0ee

View File

@ -29,7 +29,8 @@ class Simulator {
cmds.push("-l " + (options.gasLimit || this.blockchainConfig.targetGasLimit || 8000000));
// adding mnemonic only if it is defined in the blockchainConfig or options
const mnemonicAccount = this.blockchainConfig.accounts ? this.blockchainConfig.accounts.find(acc => acc.mnemonic) : {};
let mnemonicAccount = this.blockchainConfig.accounts ? this.blockchainConfig.accounts.find(acc => acc.mnemonic) : {};
mnemonicAccount = mnemonicAccount || {};
const simulatorMnemonic = mnemonicAccount.mnemonic || options.simulatorMnemonic;
if (simulatorMnemonic) {