File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11version https://git-lfs.github.com/spec/v1
2- oid sha256:3fe80a1f5c4051e72d46485f26a79001c6007380ee60a75abf38db760712d661
3- size 535220
2+ oid sha256:6fa92304a0135af876702ecfe6a9582ff78c65f504289fc9bccd866ceba51017
3+ size 535161
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ class TrustWeb3Provider extends EventEmitter {
202202
203203 eth_sign ( payload ) {
204204 const buffer = Utils . messageToBuffer ( payload . params [ 1 ] ) ;
205- const hex = buffer . toString ( "hex" ) ;
205+ const hex = Utils . bufferToHex ( buffer ) ;
206206 if ( isUtf8 ( buffer ) ) {
207207 this . postMessage ( "signPersonalMessage" , payload . id , { data : hex } ) ;
208208 } else {
@@ -215,7 +215,7 @@ class TrustWeb3Provider extends EventEmitter {
215215 const buffer = Utils . messageToBuffer ( message ) ;
216216 if ( buffer . length === 0 ) {
217217 // hex it
218- const hex = Buffer . from ( message ) . toString ( "hex" ) ;
218+ const hex = Utils . bufferToHex ( message ) ;
219219 this . postMessage ( "signPersonalMessage" , payload . id , { data : hex } ) ;
220220 } else {
221221 this . postMessage ( "signPersonalMessage" , payload . id , { data : message } ) ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class Utils {
5151 }
5252
5353 static bufferToHex ( buf ) {
54- return Buffer . from ( buf ) . toString ( "hex" ) ;
54+ return "0x" + Buffer . from ( buf ) . toString ( "hex" ) ;
5555 }
5656}
5757
You can’t perform that action at this time.
0 commit comments