From 47f8e2bdb4642b68c691a2b08d18f611fedae2bf Mon Sep 17 00:00:00 2001 From: noooblien Date: Tue, 4 Jun 2024 13:54:09 +0530 Subject: [PATCH] Remove chain ID restrictions in EVM types The restrictions on chain ID in the EVM transaction types dynamic_fee_tx, access_list_tx and legacy_tx were removed. This increases flexibility and clears up the code since it previously explicitly checked for a chain ID of 9000 or 9001. --- go.mod | 3 ++- x/evm/types/access_list_tx.go | 7 ------- x/evm/types/dynamic_fee_tx.go | 8 -------- x/evm/types/legacy_tx.go | 8 -------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 580e21e..209ba08 100644 --- a/go.mod +++ b/go.mod @@ -49,6 +49,8 @@ require ( sigs.k8s.io/yaml v1.3.0 ) +require github.com/evmos/evmos/v12 v12.0.0-20230310230306-719363fbb92f // indirect + require ( cloud.google.com/go v0.110.0 // indirect cloud.google.com/go/compute v1.18.0 // indirect @@ -101,7 +103,6 @@ require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect - github.com/evmos/evmos/v12 v12.0.0-20230310230306-719363fbb92f // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect diff --git a/x/evm/types/access_list_tx.go b/x/evm/types/access_list_tx.go index d6267d9..066fc71 100644 --- a/x/evm/types/access_list_tx.go +++ b/x/evm/types/access_list_tx.go @@ -237,13 +237,6 @@ func (tx AccessListTx) Validate() error { ) } - if !(chainID.Cmp(big.NewInt(9001)) == 0 || chainID.Cmp(big.NewInt(9000)) == 0) { - return errorsmod.Wrapf( - errortypes.ErrInvalidChainID, - "chain ID must be 9000 or 9001 on Evmos, got %s", chainID, - ) - } - return nil } diff --git a/x/evm/types/dynamic_fee_tx.go b/x/evm/types/dynamic_fee_tx.go index d948d7a..97fa9aa 100644 --- a/x/evm/types/dynamic_fee_tx.go +++ b/x/evm/types/dynamic_fee_tx.go @@ -268,14 +268,6 @@ func (tx DynamicFeeTx) Validate() error { "chain ID must be present on AccessList txs", ) } - - if !(chainID.Cmp(big.NewInt(9001)) == 0 || chainID.Cmp(big.NewInt(9000)) == 0) { - return errorsmod.Wrapf( - errortypes.ErrInvalidChainID, - "chain ID must be 9000 or 9001 on Evmos, got %s", chainID, - ) - } - return nil } diff --git a/x/evm/types/legacy_tx.go b/x/evm/types/legacy_tx.go index 6846875..60fe57f 100644 --- a/x/evm/types/legacy_tx.go +++ b/x/evm/types/legacy_tx.go @@ -213,14 +213,6 @@ func (tx LegacyTx) Validate() error { "chain ID must be present on AccessList txs", ) } - - if !(chainID.Cmp(big.NewInt(9001)) == 0 || chainID.Cmp(big.NewInt(9000)) == 0) { - return errorsmod.Wrapf( - errortypes.ErrInvalidChainID, - "chain ID must be 9000 or 9001 on Evmos, got %s", chainID, - ) - } - return nil }