Allow user to specify "random" as privateKey configuration. In such case embark generates some random privateKey for the account.
This commit is contained in:
parent
c782f9b0a8
commit
f84cef0932
|
@ -31,6 +31,12 @@ class AccountParser {
|
|||
hexBalance = getHexBalanceFromString(accountConfig.balance, web3);
|
||||
//hexBalance = getHexBalanceFromString(accountConfig.balance, web3);
|
||||
}
|
||||
|
||||
if (accountConfig.privateKey === 'random') {
|
||||
let randomAccount = web3.eth.accounts.create();
|
||||
accountConfig.privateKey = randomAccount.privateKey;
|
||||
}
|
||||
|
||||
if (accountConfig.privateKey) {
|
||||
if (!accountConfig.privateKey.startsWith('0x')) {
|
||||
accountConfig.privateKey = '0x' + accountConfig.privateKey;
|
||||
|
|
Loading…
Reference in New Issue