Skip to content

Commit 59eacbf

Browse files
committed
tx: used BN as yParity and chainId input in getSenderPublicKey()
1 parent e57e08c commit 59eacbf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/tx/src/eip2930Transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ export default class EIP2930Transaction extends BaseTransaction<EIP2930Transacti
351351
try {
352352
return ecrecover(
353353
msgHash,
354-
yParity.toNumber() + 27, // Recover the 27 which was stripped from ecsign
354+
yParity.addn(27), // Recover the 27 which was stripped from ecsign
355355
bnToRlp(r),
356356
bnToRlp(s)
357357
)

packages/tx/src/legacyTransaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export default class LegacyTransaction extends BaseTransaction<LegacyTransaction
258258
v,
259259
bnToRlp(r),
260260
bnToRlp(s),
261-
this._signedTxImplementsEIP155() ? this.getChainId() : undefined
261+
this._signedTxImplementsEIP155() ? new BN(this.getChainId().toString()) : undefined
262262
)
263263
} catch (e) {
264264
throw new Error('Invalid Signature')

0 commit comments

Comments
 (0)