From 96605e43315027216d5d04ac7fc0575075ba8f82 Mon Sep 17 00:00:00 2001 From: buddho Date: Fri, 22 Mar 2024 17:16:14 +0800 Subject: [PATCH] remove useless Config() (#2326) --- consensus/parlia/parlia.go | 4 ---- core/data_availability_test.go | 4 ---- core/evm.go | 5 ----- core/vm/runtime/runtime_test.go | 4 ---- internal/ethapi/api.go | 5 ----- 5 files changed, 22 deletions(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 733ac3f046..e77e8c0b85 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1966,10 +1966,6 @@ func (c chainContext) Engine() consensus.Engine { return c.parlia } -func (c chainContext) Config() *params.ChainConfig { - return c.Chain.Config() -} - func (c chainContext) GetHeader(hash common.Hash, number uint64) *types.Header { return c.Chain.GetHeader(hash, number) } diff --git a/core/data_availability_test.go b/core/data_availability_test.go index 153f9b948b..9cb29b079c 100644 --- a/core/data_availability_test.go +++ b/core/data_availability_test.go @@ -279,10 +279,6 @@ func (r *mockDAHeaderReader) setChasingHead(h uint64) { r.chasingHead = h } -func (r *mockDAHeaderReader) Config() *params.ChainConfig { - return r.config -} - func (r *mockDAHeaderReader) CurrentHeader() *types.Header { return &types.Header{ Number: new(big.Int).SetUint64(r.chasingHead), diff --git a/core/evm.go b/core/evm.go index e509f836d1..73f6d7bc20 100644 --- a/core/evm.go +++ b/core/evm.go @@ -19,8 +19,6 @@ package core import ( "math/big" - "github.com/ethereum/go-ethereum/params" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/consensus" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" @@ -37,9 +35,6 @@ type ChainContext interface { // GetHeader returns the header corresponding to the hash/number argument pair. GetHeader(common.Hash, uint64) *types.Header - - // Config retrieves the chain config. - Config() *params.ChainConfig } // NewEVMBlockContext creates a new context for use in the EVM. diff --git a/core/vm/runtime/runtime_test.go b/core/vm/runtime/runtime_test.go index be34bd5f07..b9e3c8ed66 100644 --- a/core/vm/runtime/runtime_test.go +++ b/core/vm/runtime/runtime_test.go @@ -236,10 +236,6 @@ func (d *dummyChain) Engine() consensus.Engine { return nil } -func (d *dummyChain) Config() *params.ChainConfig { - return nil -} - // GetHeader returns the hash corresponding to their hash. func (d *dummyChain) GetHeader(h common.Hash, n uint64) *types.Header { d.counter++ diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 866494f3cc..d29e92abc1 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1156,7 +1156,6 @@ func (diff *BlockOverrides) Apply(blockCtx *vm.BlockContext) { type ChainContextBackend interface { Engine() consensus.Engine HeaderByNumber(context.Context, rpc.BlockNumber) (*types.Header, error) - ChainConfig() *params.ChainConfig } // ChainContext is an implementation of core.ChainContext. It's main use-case @@ -1175,10 +1174,6 @@ func (context *ChainContext) Engine() consensus.Engine { return context.b.Engine() } -func (context *ChainContext) Config() *params.ChainConfig { - return context.b.ChainConfig() -} - func (context *ChainContext) GetHeader(hash common.Hash, number uint64) *types.Header { // This method is called to get the hash for a block number when executing the BLOCKHASH // opcode. Hence no need to search for non-canonical blocks.