evm: move ChainConfig to Params (#266)

* evm: move ChainConfig to Params

* fixes

* fix test
This commit is contained in:
Federico Kunze Küllmer
2021-07-14 05:13:55 -04:00
committed by GitHub
parent 74b7eaf431
commit e09bf23bd0
26 changed files with 1185 additions and 1884 deletions
-14
View File
@@ -17,7 +17,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
ethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/params"
ethermint "github.com/tharsis/ethermint/types"
evmtypes "github.com/tharsis/ethermint/x/evm/types"
@@ -42,8 +41,6 @@ type Backend interface {
// Used by log filter
GetTransactionLogs(txHash common.Hash) ([]*ethtypes.Log, error)
BloomStatus() (uint64, uint64)
ChainConfig() *params.ChainConfig
}
var _ Backend = (*EVMBackend)(nil)
@@ -383,14 +380,3 @@ func (e *EVMBackend) GetLogsByNumber(blockNum types.BlockNumber) ([][]*ethtypes.
func (e *EVMBackend) BloomStatus() (uint64, uint64) {
return 4096, 0
}
// ChainConfig returns the chain configuration for the chain. This method returns a nil pointer if
// the query fails.
func (e *EVMBackend) ChainConfig() *params.ChainConfig {
res, err := e.queryClient.QueryClient.ChainConfig(e.ctx, &evmtypes.QueryChainConfigRequest{})
if err != nil {
return nil
}
return res.Config.EthereumConfig(e.chainID)
}