@@ -9,9 +9,7 @@ class DevFunds {
99 this . blockchainConfig = blockchainConfig ;
1010 this . accounts = [ ] ;
1111 this . numAccounts = this . blockchainConfig . account . numAccounts || 0 ;
12- this . password = readFileSync ( dappPath ( 'config/development/password' ) ) ;
13- this . password = 'dev_password' ;
14- this . existingNumAccounts = 0 ;
12+ this . password = readFileSync ( dappPath ( 'config/development/password' ) , 'utf8' ) . replace ( '\n' , '' ) ;
1513 this . web3 = new Web3 ( ) ;
1614 this . balance = Web3 . utils . toWei ( "1" , "ether" ) ;
1715 if ( this . blockchainConfig . account . balance ) {
@@ -27,14 +25,14 @@ class DevFunds {
2725
2826 this . web3 . eth . getAccounts ( ) . then ( ( accounts ) => {
2927 this . web3 . eth . defaultAccount = accounts [ 0 ] ;
30- this . existingNumAccounts = accounts . length ;
28+ this . accounts = accounts ;
3129 cb ( ) ;
3230 } ) ;
3331 }
3432
3533 createAccounts ( numAccounts , password , cb ) {
36- console . dir ( "creating " + ( numAccounts - this . existingNumAccounts ) + " new accounts with password " + password ) ;
37- async . timesLimit ( ( numAccounts - this . existingNumAccounts ) , 1 , ( _ , next ) => {
34+ console . dir ( "creating " + ( numAccounts - this . accounts . length ) + " new accounts with password " + password ) ;
35+ async . timesLimit ( ( numAccounts - this . accounts . length ) , 1 , ( _ , next ) => {
3836 console . dir ( "--- creating new account" ) ;
3937 this . web3 . eth . personal . newAccount ( password , next ) ;
4038 } , ( err , accounts ) => {
@@ -89,7 +87,7 @@ class DevFunds {
8987 this . fundAccounts ( this . balance , next ) ;
9088 }
9189 ] , ( err ) => {
92- console . trace ( `--- COMPLETED THE ACCOUNTS (${ this . accounts . join ( ', ' ) } and funded with ${ this . balance } wei)` ) ;
90+ console . dir ( `--- COMPLETED THE ACCOUNTS (${ this . accounts . join ( ', ' ) } and funded with ${ this . balance } wei)` ) ;
9391 if ( err ) console . error ( 'Error creating, unlocking, and funding accounts' , err ) ;
9492
9593 // this.web3.eth.getAccounts().then((accounts) => {
0 commit comments