@@ -21,33 +21,12 @@ const addAccount = async (address, privateKey) => {
21
21
mainAcc = accountList [ 0 ] ;
22
22
}
23
23
const web3Eth = new Web3Eth ( clientUrl ) ;
24
- console . error ( 'accountList' , accountList ) ;
25
- console . error ( 'address' , address ) ;
26
- console . error ( 'privateKey' , privateKey ) ;
27
- if ( ! accountList . find ( acc => acc . address === address ) ) {
28
- try {
29
- console . log ( 'gen_accounts.js: getSystemTestBackend() ' , getSystemTestBackend ( ) ) ;
30
- console . log (
31
- "gen_accounts.js: getSystemTestBackend() === 'geth' " ,
32
- getSystemTestBackend ( ) === 'geth' ,
33
- ) ;
34
24
35
- const modifiedPrivateKey =
36
- getSystemTestBackend ( ) === 'geth' ? privateKey . slice ( 2 ) : privateKey ;
37
- console . log ( 'gen_accounts.js: import for modifiedPrivateKey: ' , modifiedPrivateKey ) ;
38
- await web3Personal . importRawKey ( modifiedPrivateKey , '123456' ) ;
39
- console . log ( 'gen_accounts.js: import for modifiedPrivateKey succeeded' ) ;
40
- } catch ( error ) {
41
- console . error ( error ) ;
42
- if ( getSystemTestBackend ( ) === 'geth' ) {
43
- console . warn (
44
- 'gen_accounts.js: The function importRawKey did not work for geth when removing `0x` from private key. Try without removing it...' ,
45
- ) ;
46
- console . log ( 'gen_accounts.js: import for privateKey: ' , privateKey ) ;
47
- await web3Personal . importRawKey ( privateKey , '123456' ) ;
48
- console . log ( 'gen_accounts.js: import for privateKey succeeded' ) ;
49
- }
50
- }
25
+ if ( ! accountList . find ( acc => acc . address === address ) ) {
26
+ await web3Personal . importRawKey (
27
+ getSystemTestBackend ( ) === 'geth' ? privateKey . slice ( 2 ) : privateKey ,
28
+ '123456' ,
29
+ ) ;
51
30
}
52
31
53
32
await web3Eth . sendTransaction ( {
0 commit comments