From c6eef03a0f6a297cec650d74de5fc0dabe8e1b78 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Wed, 22 Nov 2023 13:37:21 +0800 Subject: [PATCH] fix eth config --- x/evm/types/chain_config.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/x/evm/types/chain_config.go b/x/evm/types/chain_config.go index 08842e59a6..5ebc71dd1d 100644 --- a/x/evm/types/chain_config.go +++ b/x/evm/types/chain_config.go @@ -48,13 +48,19 @@ func (cc ChainConfig) EthereumConfig(chainID *big.Int) *params.ChainConfig { ArrowGlacierBlock: getBlockValue(cc.ArrowGlacierBlock), GrayGlacierBlock: getBlockValue(cc.GrayGlacierBlock), MergeNetsplitBlock: getBlockValue(cc.MergeNetsplitBlock), - ShanghaiTime: &cc.ShanghaiTime, - CancunTime: &cc.CancunTime, - PragueTime: &cc.PragueTime, TerminalTotalDifficulty: nil, Ethash: nil, Clique: nil, } + if cc.ShanghaiTime > 0 { + cfg.ShanghaiTime = &cc.ShanghaiTime + } + if cc.CancunTime > 0 { + cfg.CancunTime = &cc.CancunTime + } + if cc.PragueTime > 0 { + cfg.PragueTime = &cc.PragueTime + } return cfg }