Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
s can be undefined here
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Mar 15, 2022
1 parent 9f0e3af commit 5f78b56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chains/ethereum/transaction/src/transaction-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { SECP256K1_MAX_PRIVATE_KEY_DIV_2 } from "@ganache/secp256k1";
function assertValidTransactionSValue(common: Common, tx: LegacyTransaction | EIP2930AccessListTransaction | EIP1559FeeMarketTransaction) {
// Transaction signatures whose s-value is greater than secp256k1n/2 are
// invalid after the homestead hardfork. See: https://eips.ethereum.org/EIPS/eip-2
if (common.gteHardfork('homestead') && tx.s.toBigInt() > SECP256K1_MAX_PRIVATE_KEY_DIV_2) {
if (tx.s && tx.s.toBigInt() > SECP256K1_MAX_PRIVATE_KEY_DIV_2 && common.gteHardfork('homestead')) {
throw new Error("Invalid Signature: s-values greater than secp256k1n/2 are considered invalid")
}
}
Expand Down

0 comments on commit 5f78b56

Please sign in to comment.