Skip to content

Commit

Permalink
fix for chainId compare.
Browse files Browse the repository at this point in the history
  • Loading branch information
lolieatcat committed Mar 12, 2021
1 parent db60548 commit 24ce6a1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2.1.10-beta
2.1.10-beta.1

2 changes: 1 addition & 1 deletion core/types/transaction_signing.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error) {
return common.Address{}, ErrInvalidChainId
}

if IsEthereumTx(tx.Txtype()) && tx.ChainId().Cmp(s.chainId) == 0 {
if IsEthereumTx(tx.Txtype()) && tx.ChainId().Cmp(s.chainId) == 0 && params.IsOldChainId(s.chainId.Uint64()) {
return common.Address{}, ErrInvalidChainId
}

Expand Down
24 changes: 24 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,27 @@ func JupiterChainId(chainId uint64) uint64 {

return NOT_JUPITER_CHAIN_ID
}

func IsOldChainId(chainId uint64) bool {
if chainId == MAINNET_CHAIN_ID {
return true
}

if chainId == TESTNET_CHAIN_ID {
return true
}

if chainId == INTERNAL_CHAIN_ID {
return true
}

if chainId == PLUTO_CHAIN_ID {
return true
}

if chainId == PLUTODEV_CHAIN_ID {
return true
}

return false
}
8 changes: 4 additions & 4 deletions params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
)

const (
VersionMajor = 2 // Major version component of the current release
VersionMinor = 1 // Minor version component of the current release
VersionPatch = 10 // Patch version component of the current release
VersionMeta = "beta" // Version metadata to append to the version string
VersionMajor = 2 // Major version component of the current release
VersionMinor = 1 // Minor version component of the current release
VersionPatch = 10 // Patch version component of the current release
VersionMeta = "beta.1" // Version metadata to append to the version string
)

// Version holds the textual version string.
Expand Down

0 comments on commit 24ce6a1

Please sign in to comment.