File tree Expand file tree Collapse file tree 3 files changed +4947
-4875
lines changed Expand file tree Collapse file tree 3 files changed +4947
-4875
lines changed Original file line number Diff line number Diff line change 32
32
"typescript" : " ^4.1.5"
33
33
},
34
34
"dependencies" : {
35
- "eth-sig-util" : " ^3 .0.1"
35
+ "@metamask/ eth-sig-util" : " ^4 .0.1"
36
36
}
37
37
}
Original file line number Diff line number Diff line change 1
- import { personalSign , decrypt } from 'eth-sig-util'
1
+ import { personalSign , decrypt } from '@metamask/ eth-sig-util'
2
2
3
3
type ProviderSetup = {
4
4
address : string
@@ -76,9 +76,9 @@ export class MockProvider implements IMockProvider {
76
76
return Promise . resolve ( this . chainId )
77
77
78
78
case 'personal_sign' : {
79
- const privKey = Buffer . from ( this . setup . privateKey , 'hex' ) ;
79
+ const privateKey = Buffer . from ( this . setup . privateKey , 'hex' ) ;
80
80
81
- const signed : string = personalSign ( privKey , { data : params [ 0 ] } )
81
+ const signed : string = personalSign ( { privateKey , data : params [ 0 ] } )
82
82
83
83
this . log ( 'signed' , signed )
84
84
@@ -94,9 +94,9 @@ export class MockProvider implements IMockProvider {
94
94
95
95
const stripped = params [ 0 ] . substring ( 2 )
96
96
const buff = Buffer . from ( stripped , 'hex' ) ;
97
- const data = JSON . parse ( buff . toString ( 'utf8' ) ) ;
97
+ const encryptedData = JSON . parse ( buff . toString ( 'utf8' ) ) ;
98
98
99
- const decrypted : string = decrypt ( data , this . setup . privateKey )
99
+ const decrypted : string = decrypt ( { encryptedData , privateKey : this . setup . privateKey } )
100
100
101
101
return Promise . resolve ( decrypted )
102
102
}
You can’t perform that action at this time.
0 commit comments