File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -135,19 +135,7 @@ export default class Transaction {
135
135
* Computes a sha3-256 hash of the serialized tx
136
136
*/
137
137
hash ( ) : Buffer {
138
- const values = [
139
- bnToRlp ( this . nonce ) ,
140
- bnToRlp ( this . gasPrice ) ,
141
- bnToRlp ( this . gasLimit ) ,
142
- this . to !== undefined ? this . to . buf : Buffer . from ( [ ] ) ,
143
- bnToRlp ( this . value ) ,
144
- this . data ,
145
- this . v ? bnToRlp ( this . v ) : Buffer . from ( [ ] ) ,
146
- this . r ? bnToRlp ( this . r ) : Buffer . from ( [ ] ) ,
147
- this . s ? bnToRlp ( this . s ) : Buffer . from ( [ ] ) ,
148
- ]
149
-
150
- return rlphash ( values )
138
+ return rlphash ( this . raw ( ) )
151
139
}
152
140
153
141
getMessageToSign ( ) {
@@ -383,14 +371,7 @@ export default class Transaction {
383
371
}
384
372
385
373
private _getMessageToSign ( withEIP155 : boolean ) {
386
- const values = [
387
- bnToRlp ( this . nonce ) ,
388
- bnToRlp ( this . gasPrice ) ,
389
- bnToRlp ( this . gasLimit ) ,
390
- this . to !== undefined ? this . to . buf : Buffer . from ( [ ] ) ,
391
- bnToRlp ( this . value ) ,
392
- this . data ,
393
- ]
374
+ const values = this . raw ( ) . slice ( 0 , 6 )
394
375
395
376
if ( withEIP155 ) {
396
377
values . push ( toBuffer ( this . getChainId ( ) ) )
You can’t perform that action at this time.
0 commit comments