@@ -28,7 +28,7 @@ const singletonNonceSubProvider = new NonceSubProvider();
2828class HDWalletProvider {
2929 private hdwallet ?: EthereumHDKey ;
3030 private walletHdpath : string ;
31- private wallets : { [ address : string ] : ethJSWallet } ; // TODO refactor
31+ private wallets : { [ address : string ] : ethJSWallet } ;
3232 private addresses : string [ ] ;
3333
3434 public engine : ProviderEngine ;
@@ -52,7 +52,7 @@ class HDWalletProvider {
5252 `Malformed provider URL: '${ provider } '` ,
5353 'Please specify a correct URL, using the http, https, ws, or wss protocol.' ,
5454 ''
55- ] . join ( "\n" )
55+ ] . join ( '\n' )
5656 ) ;
5757 }
5858
@@ -77,7 +77,7 @@ class HDWalletProvider {
7777 const wallet = this . hdwallet
7878 . derivePath ( this . walletHdpath + i )
7979 . getWallet ( ) ;
80- const addr = `0x${ wallet . getAddress ( ) . toString ( " hex" ) } ` ;
80+ const addr = `0x${ wallet . getAddress ( ) . toString ( ' hex' ) } ` ;
8181 this . addresses . push ( addr ) ;
8282 this . wallets [ addr ] = wallet ;
8383 }
@@ -87,7 +87,7 @@ class HDWalletProvider {
8787 const ethUtilValidation = ( privateKeys : string [ ] ) => {
8888 // crank the addresses out
8989 for ( let i = addressIndex ; i < addressIndex + numAddresses ; i ++ ) {
90- const privateKey = Buffer . from ( privateKeys [ i ] . replace ( "0x" , "" ) , " hex" ) ;
90+ const privateKey = Buffer . from ( privateKeys [ i ] . replace ( '0x' , '' ) , ' hex' ) ;
9191 if ( EthUtil . isValidPrivate ( privateKey ) ) {
9292 const wallet = ethJSWallet . fromPrivateKey ( privateKey ) ;
9393 const address = wallet . getAddressString ( ) ;
@@ -112,9 +112,9 @@ class HDWalletProvider {
112112 } ,
113113 getPrivateKey ( address : string , cb : any ) {
114114 if ( ! tmp_wallets [ address ] ) {
115- return cb ( " Account not found" ) ;
115+ return cb ( ' Account not found' ) ;
116116 } else {
117- cb ( null , tmp_wallets [ address ] . getPrivateKey ( ) . toString ( " hex" ) ) ;
117+ cb ( null , tmp_wallets [ address ] . getPrivateKey ( ) . toString ( ' hex' ) ) ;
118118 }
119119 } ,
120120 signTransaction ( txParams : any , cb : any ) {
@@ -123,20 +123,20 @@ class HDWalletProvider {
123123 if ( tmp_wallets [ from ] ) {
124124 pkey = tmp_wallets [ from ] . getPrivateKey ( ) ;
125125 } else {
126- cb ( " Account not found" ) ;
126+ cb ( ' Account not found' ) ;
127127 }
128128 const tx = new Transaction ( txParams ) ;
129129 tx . sign ( pkey as Buffer ) ;
130- const rawTx = `0x${ tx . serialize ( ) . toString ( " hex" ) } ` ;
130+ const rawTx = `0x${ tx . serialize ( ) . toString ( ' hex' ) } ` ;
131131 cb ( null , rawTx ) ;
132132 } ,
133133 signMessage ( { data, from } : any , cb : any ) {
134134 const dataIfExists = data ;
135135 if ( ! dataIfExists ) {
136- cb ( " No data to sign" ) ;
136+ cb ( ' No data to sign' ) ;
137137 }
138138 if ( ! tmp_wallets [ from ] ) {
139- cb ( " Account not found" ) ;
139+ cb ( ' Account not found' ) ;
140140 }
141141 let pkey = tmp_wallets [ from ] . getPrivateKey ( ) ;
142142 const dataBuff = EthUtil . toBuffer ( dataIfExists ) ;
@@ -187,7 +187,7 @@ class HDWalletProvider {
187187 }
188188
189189 public getAddress ( idx ?: number ) : string {
190- debugInstance ( " getting addresses" , this . addresses [ 0 ] , idx ) ;
190+ debugInstance ( ' getting addresses' , this . addresses [ 0 ] , idx ) ;
191191
192192 if ( ! idx ) {
193193 return this . addresses [ 0 ] ;
0 commit comments