Skip to content

Commit

Permalink
Remove chain ID restrictions in EVM types
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Noooblien committed Jun 4, 2024
1 parent bd096cc commit 47f8e2b
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions x/evm/types/access_list_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 0 additions & 8 deletions x/evm/types/dynamic_fee_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 0 additions & 8 deletions x/evm/types/legacy_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 47f8e2b

Please sign in to comment.