Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
cda76f9
fix tests and remove unnecessary setup
almk-dev Aug 15, 2025
bcd494d
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 15, 2025
517d783
fix build complaints
almk-dev Aug 15, 2025
30cf3c6
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 18, 2025
f7183ee
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 18, 2025
fddffea
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 18, 2025
95b6b98
fix systemtest
almk-dev Aug 19, 2025
9ae30ee
fix solidity
almk-dev Aug 19, 2025
89cacfd
revert default config denom
almk-dev Aug 19, 2025
d3dfc7f
align default config
almk-dev Aug 19, 2025
21b5766
fast runners
almk-dev Aug 19, 2025
7c83c76
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 19, 2025
0ce0239
solidity still doesnt work on depot
almk-dev Aug 19, 2025
9dda87b
no meaningful speedup
almk-dev Aug 19, 2025
f74b4c1
Merge branch 'main' into stack-1409-clean-up-chain-config
Aug 19, 2025
5132d13
Merge branch 'main' into stack-1409-clean-up-chain-config
Aug 19, 2025
f122ab4
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 20, 2025
3ed2826
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 20, 2025
8dde9ed
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 21, 2025
29721f5
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 21, 2025
68f0ebd
Merge branch 'main' into stack-1409-clean-up-chain-config
Aug 21, 2025
5a5968f
add evm var based configs
almk-dev Aug 22, 2025
9fb550c
Merge branch 'stack-1409-clean-up-chain-config' of github.com:cosmos/…
almk-dev Aug 22, 2025
ef8a61d
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 22, 2025
539c455
lint
almk-dev Aug 22, 2025
4a88554
revert sealed removal
almk-dev Aug 22, 2025
f79e5fb
remove refences to deprecated func
almk-dev Aug 22, 2025
267a398
remove newlines
almk-dev Aug 22, 2025
c03643f
lint
almk-dev Aug 22, 2025
bc9acbc
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 22, 2025
b81a780
add configurator configure
almk-dev Aug 22, 2025
444cacd
add changelog
almk-dev Aug 22, 2025
430deb7
Revert "remove refences to deprecated func"
almk-dev Aug 22, 2025
e98bd4a
Remove unused testutil/config import
almk-dev Aug 22, 2025
39cbb96
add back defchain
almk-dev Aug 22, 2025
e2bc65d
cleanup
almk-dev Aug 25, 2025
e85f0f0
clean up extra config functions and add tests
almk-dev Aug 25, 2025
1fda943
remove infinite loop debug logic
almk-dev Aug 25, 2025
608c530
replace panic with no-op warning
almk-dev Aug 25, 2025
2e7e401
fix variable name alignment
almk-dev Aug 25, 2025
3df3bd0
cleanup toml usage for new test pattern
almk-dev Aug 25, 2025
c2aaef8
clean up doc strings
almk-dev Aug 25, 2025
8d10e73
remove unused appOptions config
almk-dev Aug 25, 2025
43e86fd
update doc strings that are no longer relevant
almk-dev Aug 25, 2025
05fa144
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 26, 2025
cc8ccac
change app config chain info to coin
almk-dev Aug 26, 2025
676ef59
Merge branch 'main' into stack-1409-clean-up-chain-config
almk-dev Aug 27, 2025
e7d1d28
revert panic for ResetTestConfig
almk-dev Aug 27, 2025
9c85141
add testutil refactor
almk-dev Aug 28, 2025
d4c5dd1
rev root
almk-dev Aug 28, 2025
c1b1f6f
remove unused func
almk-dev Sep 1, 2025
3a6d73c
clean up staged
almk-dev Sep 1, 2025
8319f7b
remove unused client func
almk-dev Sep 1, 2025
6df3721
fix merge conflicts
almk-dev Sep 2, 2025
e391692
clear duplicate constants
almk-dev Sep 2, 2025
f885ee4
fix burn test setup
almk-dev Sep 2, 2025
92674b9
fix merge conflicts
almk-dev Sep 3, 2025
a542c04
clean up fractional test
almk-dev Sep 3, 2025
d1986fc
add chainconfig and test refactor
almk-dev Sep 10, 2025
0f321c3
fix merge conflictsi
almk-dev Sep 10, 2025
693beb2
fix fee checker
almk-dev Sep 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions: read-all
jobs:
analyze:
name: Analyze
runs-on: depot-ubuntu-24.04-8
runs-on: depot-ubuntu-24.04-4
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions: read-all

jobs:
cleanup-runs:
runs-on: ubuntu-latest
runs-on: depot-ubuntu-24.04-4
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [\#511](https://github.com/cosmos/evm/pull/511) Minor code cleanup for `AddPrecompileFn`.
- [\#544](https://github.com/cosmos/evm/pull/544) Parse logs from the txResult.Data and avoid emitting EVM events to cosmos-sdk events.
- [\#582](https://github.com/cosmos/evm/pull/582) Add block max-gas (from genesis.json) and new min-tip (from app.toml/flags) ingestion into mempool config
- [\#436](https://github.com/cosmos/evm/pull/436) Refactor and consolidate chain config helpers and constants for test suites

### FEATURES

Expand Down
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,16 @@ test-race: ARGS=-race
test-race: TEST_PACKAGES=$(PACKAGES_UNIT)
test-race: run-tests

# Chain configuration environment variables
CHAIN_ENV_VARS = $(if $(CHAIN_ID),CHAIN_ID="$(CHAIN_ID)") \
$(if $(EVM_CHAIN_ID),EVM_CHAIN_ID="$(EVM_CHAIN_ID)") \
$(if $(DISPLAY_DENOM),DISPLAY_DENOM="$(DISPLAY_DENOM)") \
$(if $(DECIMALS),DECIMALS="$(DECIMALS)") \
$(if $(EXTENDED_DECIMALS),EXTENDED_DECIMALS="$(EXTENDED_DECIMALS)")

test-evmd: ARGS=-timeout=15m
test-evmd:
@cd evmd && go test -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD)
@cd evmd && $(CHAIN_ENV_VARS) go test -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD)

test-unit-cover: ARGS=-timeout=15m -coverprofile=coverage.txt -covermode=atomic
test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT)
Expand Down Expand Up @@ -196,7 +203,7 @@ test-scripts:

test-solidity:
@echo "Beginning solidity tests..."
./scripts/run-solidity-tests.sh
@$(CHAIN_ENV_VARS) ./scripts/run-solidity-tests.sh

.PHONY: run-tests test test-all $(TEST_TARGETS)

Expand Down
13 changes: 6 additions & 7 deletions ante/cosmos/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/cosmos/evm/ante/cosmos"
"github.com/cosmos/evm/encoding"
"github.com/cosmos/evm/testutil"
"github.com/cosmos/evm/testutil/constants"
testconfig "github.com/cosmos/evm/testutil/config"
evmtypes "github.com/cosmos/evm/x/vm/types"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand All @@ -21,17 +21,16 @@ import (
)

func TestAuthzLimiterDecorator(t *testing.T) {
evmConfigurator := evmtypes.NewEVMConfigurator().
WithEVMCoinInfo(constants.ExampleChainCoinInfo[constants.ExampleChainID])
err := evmConfigurator.Configure()
require.NoError(t, err)
chainConfig := testconfig.DefaultChainConfig
evmChainID := chainConfig.EvmConfig.ChainConfig.ChainId
evmCoinInfo := chainConfig.EvmConfig.CoinInfo
evmDenom := evmCoinInfo.GetDenom()

encodingCfg := encoding.MakeConfig(constants.ExampleChainID.EVMChainID)
encodingCfg := encoding.MakeConfig(evmChainID)
txCfg := encodingCfg.TxConfig
testPrivKeys, testAddresses, err := testutil.GeneratePrivKeyAddressPairs(5)
require.NoError(t, err)

evmDenom := evmtypes.GetEVMCoinDenom()
distantFuture := time.Date(9000, 1, 1, 0, 0, 0, 0, time.UTC)

validator := sdk.ValAddress(testAddresses[4])
Expand Down
25 changes: 15 additions & 10 deletions ante/evm/fee_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
"github.com/cosmos/evm/ante/evm"
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
"github.com/cosmos/evm/encoding"
"github.com/cosmos/evm/testutil/config"
testconstants "github.com/cosmos/evm/testutil/constants"
testconfig "github.com/cosmos/evm/testutil/config"
"github.com/cosmos/evm/types"
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
evmtypes "github.com/cosmos/evm/x/vm/types"
Expand Down Expand Up @@ -57,9 +56,15 @@ func TestSDKTxFeeChecker(t *testing.T) {
// with extension option
// without extension option
// london hardfork enableness
chainID := uint64(config.EighteenDecimalsChainID)
chainConfig := testconfig.DefaultChainConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto (#436 (comment))

chainID := chainConfig.EvmConfig.ChainConfig.EthereumConfig().ChainID
chainDenomAtto := chainConfig.EvmConfig.CoinInfo.GetDenom()
encodingConfig := encoding.MakeConfig(chainID)
err := config.EvmAppOptions(chainID)

// Configure EVM with test configuration
configurator := typesutil.NewEVMConfigurator()
configurator.ResetTestConfig()
err := configurator.WithEVMCoinInfo(chainConfig.EvmConfig).Configure()
require.NoError(t, err)

evmDenom := evmtypes.GetEVMCoinDenom()
Expand Down Expand Up @@ -110,7 +115,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder()
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10))))
return txBuilder.GetTx()
},
false,
Expand Down Expand Up @@ -155,7 +160,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder()
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10))))
return txBuilder.GetTx()
},
true,
Expand All @@ -172,7 +177,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder()
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))
return txBuilder.GetTx()
},
true,
Expand All @@ -189,7 +194,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder)
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction))))

option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{})
require.NoError(t, err)
Expand All @@ -210,7 +215,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder)
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))

option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{
MaxPriorityPrice: math.LegacyNewDec(5).MulInt(evmtypes.DefaultPriorityReduction),
Expand All @@ -233,7 +238,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
func() sdk.FeeTx {
txBuilder := encodingConfig.TxConfig.NewTxBuilder().(authtx.ExtensionOptionsTxBuilder)
txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(testconstants.ExampleAttoDenom, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(chainDenomAtto, math.NewInt(10).Mul(evmtypes.DefaultPriorityReduction).Add(math.NewInt(10)))))

// set negative priority fee
option, err := codectypes.NewAnyWithValue(&types.ExtensionOptionDynamicFeeTx{
Expand Down
11 changes: 7 additions & 4 deletions ante/evm/mono_decorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/cosmos/evm/ante/evm"
"github.com/cosmos/evm/crypto/ethsecp256k1"
"github.com/cosmos/evm/encoding"
"github.com/cosmos/evm/testutil/config"
testconfig "github.com/cosmos/evm/testutil/config"
utiltx "github.com/cosmos/evm/testutil/tx"
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
"github.com/cosmos/evm/x/vm/statedb"
Expand Down Expand Up @@ -119,7 +119,9 @@ func signMsgEthereumTx(t *testing.T, privKey *ethsecp256k1.PrivKey, args *evmsdk
msg := evmsdktypes.NewTx(args)
fromAddr := common.BytesToAddress(privKey.PubKey().Address().Bytes())
msg.From = fromAddr.Bytes()
ethSigner := ethtypes.LatestSignerForChainID(evmsdktypes.GetEthChainConfig().ChainID)
// Use the configured chain ID instead of the default one
chainID := new(big.Int).SetUint64(testconfig.DefaultChainConfig.EvmConfig.ChainConfig.ChainId)
ethSigner := ethtypes.LatestSignerForChainID(chainID)
require.NoError(t, msg.Sign(ethSigner, utiltx.NewSigner(privKey)))
return msg
}
Expand All @@ -144,8 +146,9 @@ func toMsgSlice(msgs []*evmsdktypes.MsgEthereumTx) []sdk.Msg {
}

func TestMonoDecorator(t *testing.T) {
chainID := uint64(config.EighteenDecimalsChainID)
require.NoError(t, config.EvmAppOptions(chainID))
chainConfig := testconfig.DefaultChainConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] I think we could commonize default setup code (L149-L156) in testutil/somewhere dir.

chainID := chainConfig.EvmConfig.ChainConfig.ChainId

cfg := encoding.MakeConfig(chainID)

testCases := []struct {
Expand Down
4 changes: 2 additions & 2 deletions ante/sigverify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/cosmos/evm/ante"
"github.com/cosmos/evm/crypto/ethsecp256k1"
"github.com/cosmos/evm/encoding"
"github.com/cosmos/evm/server/config"
testconfig "github.com/cosmos/evm/testutil/config"

storetypes "cosmossdk.io/store/types"

Expand All @@ -27,7 +27,7 @@ func TestConsumeSignatureVerificationGas(t *testing.T) {
params := authtypes.DefaultParams()
msg := []byte{1, 2, 3, 4}

encodingConfig := encoding.MakeConfig(config.DefaultEVMChainID)
encodingConfig := encoding.MakeConfig(testconfig.DefaultChainConfig.ChainInfo.EVMChainID)
cdc := encodingConfig.Amino

p := authtypes.DefaultParams()
Expand Down
25 changes: 10 additions & 15 deletions config/evm_app_options.go → config/app_options.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package config

import (
"fmt"

"github.com/ethereum/go-ethereum/core/vm"

evmtypes "github.com/cosmos/evm/x/vm/types"
Expand All @@ -19,49 +17,46 @@ type EVMOptionsFn func(uint64) error

var sealed = false

// EvmAppOptionsWithConfig sets up EVM configuration with the provided coin info and activators.
func EvmAppOptionsWithConfig(
chainID uint64,
chainsCoinInfo map[uint64]evmtypes.EvmCoinInfo,
cosmosEVMActivators map[int]func(*vm.JumpTable),
coinInfo evmtypes.EvmCoinInfo,
activators map[int]func(*vm.JumpTable),
) error {
if sealed {
return nil
}

if err := EvmAppOptionsWithConfigWithReset(chainID, chainsCoinInfo, cosmosEVMActivators, false); err != nil {
if err := EvmAppOptionsWithConfigWithReset(chainID, coinInfo, activators, false); err != nil {
return err
}

sealed = true
return nil
}

// EvmAppOptionsWithConfigWithReset sets up EVM configuration with an optional reset flag
// to allow reconfiguration during testing.
func EvmAppOptionsWithConfigWithReset(
chainID uint64,
chainsCoinInfo map[uint64]evmtypes.EvmCoinInfo,
cosmosEVMActivators map[int]func(*vm.JumpTable),
coinInfo evmtypes.EvmCoinInfo,
activators map[int]func(*vm.JumpTable),
withReset bool,
) error {
coinInfo, found := chainsCoinInfo[chainID]
if !found {
return fmt.Errorf("unknown chain id: %d", chainID)
}

// set the denom info for the chain
if err := setBaseDenom(coinInfo); err != nil {
return err
}

ethCfg := evmtypes.DefaultChainConfig(chainID)
configurator := evmtypes.NewEVMConfigurator()
configurator := evmtypes.NewEvmConfig()
if withReset {
// reset configuration to set the new one
configurator.ResetTestConfig()
}
err := configurator.
WithExtendedEips(cosmosEVMActivators).
WithExtendedEips(activators).
WithChainConfig(ethCfg).
// NOTE: we're using the 18 decimals default for the example chain
WithEVMCoinInfo(coinInfo).
Configure()
if err != nil {
Expand Down
12 changes: 5 additions & 7 deletions ethereum/eip712/preprocess_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/cosmos/evm/encoding"
"github.com/cosmos/evm/ethereum/eip712"
"github.com/cosmos/evm/testutil/constants"
testconfig "github.com/cosmos/evm/testutil/config"
utiltx "github.com/cosmos/evm/testutil/tx"
"github.com/cosmos/evm/types"
evmtypes "github.com/cosmos/evm/x/vm/types"
Expand All @@ -30,7 +30,7 @@ import (
// Testing Constants
var (
// chainID is used in EIP-712 tests.
chainID = uint64(constants.ExampleEIP155ChainID)
chainID = testconfig.DefaultChainConfig.ChainInfo.EVMChainID

ctx = client.Context{}.WithTxConfig(
encoding.MakeConfig(chainID).TxConfig,
Expand All @@ -39,7 +39,7 @@ var (
// feePayerAddress is the address of the fee payer used in EIP-712 tests.
feePayerAddress = fmt.Sprintf(
"%s17xpfvakm2amg962yls6f84z3kell8c5lserqta",
constants.ExampleBech32Prefix,
sdk.GetConfig().GetBech32AccountAddrPrefix(),
)
)

Expand All @@ -54,10 +54,8 @@ type TestCaseStruct struct {
}

func TestLedgerPreprocessing(t *testing.T) {
// Update bech32 prefix
sdk.GetConfig().SetBech32PrefixForAccount(constants.ExampleBech32Prefix, "")
evmConfigurator := evmtypes.NewEVMConfigurator().
WithEVMCoinInfo(constants.ExampleChainCoinInfo[constants.ExampleChainID])
coinInfo := testconfig.DefaultChainConfig.EvmConfig
evmConfigurator := evmtypes.NewEvmConfig().WithEVMCoinInfo(coinInfo)
err := evmConfigurator.Configure()
require.NoError(t, err)

Expand Down
24 changes: 18 additions & 6 deletions evmd/cmd/evmd/cmd/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"errors"
"fmt"
"io"
"path/filepath"

Expand All @@ -10,7 +11,6 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/evm/evmd"
evmdconfig "github.com/cosmos/evm/evmd/cmd/evmd/config"
Expand Down Expand Up @@ -88,14 +88,20 @@ func (a appCreator) newApp(
baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is comment about newApp and exportApp functions.

These functions are not used.
Instead, newApp and exportApp in evmd/cmd/evmd/root.go are used.

The two set of functions are functionally identical.

I think we can remove this file entirely.

// Load chain configuration from app options
chainConfig, err := evmdconfig.LoadChainConfig(appOpts)
if err != nil {
panic(fmt.Errorf("failed to load chain configuration: %w", err))
}

return evmd.NewExampleApp(
logger,
db,
traceStore,
true,
simtestutil.EmptyAppOptions{},
evmdconfig.EVMChainID,
evmdconfig.EvmAppOptions,
appOpts,
chainConfig.ChainInfo.EVMChainID,
evmdconfig.EvmAppOptionsFromConfig(chainConfig),
baseappOptions...,
)
}
Expand Down Expand Up @@ -131,14 +137,20 @@ func (a appCreator) appExport(
loadLatest = true
}

// Load chain configuration from app options
chainConfig, err := evmdconfig.LoadChainConfig(appOpts)
if err != nil {
return servertypes.ExportedApp{}, fmt.Errorf("failed to load chain configuration: %w", err)
}

evmApp = evmd.NewExampleApp(
logger,
db,
traceStore,
loadLatest,
appOpts,
evmdconfig.EVMChainID,
evmdconfig.EvmAppOptions,
chainConfig.ChainInfo.EVMChainID,
evmdconfig.EvmAppOptionsFromConfig(chainConfig),
)

if height != -1 {
Expand Down
Loading
Loading