Skip to content

Commit 105ba78

Browse files
dongsamzsystmvladjdk
authored
feat!: IBC v2 (#95)
* feat: bump up ibc-go from v8 to v10 (#51) * bump up ibc-go from v8 to v10 - bumped up ibc-go from v8 to v10 - removed unused ibc test codes because bumping unused testing codes are wasting time. we should use ibc testing package instead. * add ibc v1 transfer test added ibc v1 test cases to make sure ExampleChain works with ibc v1. disabled basefee param as default for ExampleChain to make test easier. * add ibc v2 components (module, middleware) - added ibc v2 components - copied basic v2 test cases from ibc-go v10 to make sure v2 components of ExampleChain works well. * add nil checks and convert erc20 keeper to interface in IBCMiddleware - added nil checks for app and keeper in NewIBCMiddleware to prevent nil pointer dereference. - changed erc20 keeper from struct to interface type to enable proper nil checking. * copy and modify from ibc-go testing To test certain key scenarios involving EVM messages (e.g., deploying an ERC20 contract), we needed a block header context with a proposer address. This required: - A custom `TestChain` to handle these messages. - A custom `SignAndDeliver` function to support the transaction signing and delivery process. - A custom `Coordinator` to integrate this tailored `TestChain`. Since `TestChain` and `SignAndDeliver` are directly or indirectly tied to most components in the testing package, and ibc-go cannot use a `TestChain` struct defined in our separate package, we had to copy and adapt nearly all related files to ensure compatibility and functionality. * fix: ci issues * replace deprecated functions * revert disable base fee Disabling the base fee to simplify testing is not ideal for a reference chain intended for developers building EVM-compatible chains. Ethereum relies on a fee market mechanism, and as a reference implementation, this chain should enable it by default to align with expected behavior. * update TestGetReceivedCoin Updated TestGetReceivedCoin to use the newly introduced interface instead of hardcoded strings. This improves maintainability by making the test logic more aligned with the actual send/receive flow. It also enhances readability and helps developers better understand how denoms are constructed and handled in real IBC transfers. * bump up ibc-go from v10.1.0 to v10.1.1 * tests: add ibc test cases (#63) * add basic test cases for ibc middleware v1, v2 more test cases will be added. * add test cases for ibc middleware v2 * add test cases for ibc middleware v1 and post state check * add OnAcknowledgementPacket tc for v1 ibc middleware * add OnTimeoutPacket tc for v1 ibc middleware * chore: unify variable names * use internal testing pkg and add TestOnRecvPacketNativeErc20 tc * add v1 tcs for handling erc20 native coin OnTimeoutPacket, OnAcknowledgementPacket * refactor v1 middleware test codes * apply gci * fix ci: receiver name should be same * fix ci: unify receiver name and also update comments and variable name * fix ci: run gofumpt and remove tc copy * test: update TestOnRecvPacket make sure whether it is registered as dynamic precompiled contract or not * chore: test suite name convention * fix!: replace erc20 prefix (#92) * replace erc20 native coin's prefix from: erc20/ to: erc20 * change prefix to erc20: * don't allow legacy format ValidateErc20Denom is not used anywhere except test code, but what if it is used from somewhere else in the future? We shouldn't treat legacy format as valid. * fix!: ensure ics20 precompile on ibc v1 and v2 and add test cases (#74) * test: WIP debugging ibc e2e test * fix: ics20 precompile receiver addr to bech32, not bech32 * test: add erc20 case for ics20 v1 e2e test (cherry picked from commit 2737b63160d9cefcad52cf86048638a861a478a5) * test: add ibc v2 relayer logic on testing package, add v2 ics20 precompile test cases (cherry picked from commit 886fdb7581cdcd0dcce15592aae0d8206e78a783) * chore: fix lint Useless assignment to local variable * fix!: denom trace to denom for ibc v8 -> v10 breaking changes * fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms #92 320236a * test: add native erc20 case on ics20 precompile e2e test (cherry picked from commit d8db271) * chore: fix lint (cherry picked from commit 0d998cefc0c5bb57c396c01544b3ebe610f8a510) * fix: update comments on ics20.sol * refactor: Improve variable name clarity, apply suggestions * Revert "fix!: tmp cherry-pick to remove erc20/ Prefix in Native ERC20 Coin Denoms #92" This reverts commit e5afb56. * chore: update omitted contracts json by make contracts-all * docs: update CHANGELOG.md * tests: add erc20 native coin test cases for ibc v2 middleware (#96) * add OnRecvPacketNativeERC20 test case test scenario where evm chain receives erc20 native coin through IBC * add OnTimeoutPacketNativeERC20 test case * fix ci and comments * fix test case * fix: apply review comments, add testcases, error handling --------- Co-authored-by: Hyunwoo Lee <[email protected]> Co-authored-by: Vlad J <[email protected]>
1 parent ff9b273 commit 105ba78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+6410
-1607
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [\#31](https://github.com/cosmos/evm/pull/31) Migrated example_chain to evmd
88
- Migrated evmos/go-ethereum to cosmos/go-ethereum
99
- Migrated evmos/cosmos-sdk to cosmos/cosmos-sdk
10+
- [\#95](https://github.com/cosmos/evm/pull/95) Bump up ibc-go from v8 to v10
1011

1112
### BUG FIXES
1213

@@ -24,9 +25,11 @@
2425
- Renamed protobuf files from evmos to cosmos org
2526
- [\#83](https://github.com/cosmos/evm/pull/83) Remove base fee v1 from x/feemarket
2627
- [\#93](https://github.com/cosmos/evm/pull/93) Remove legacy subspaces
28+
- [\#95](https://github.com/cosmos/evm/pull/95) Replaced erc20/ with erc20 in native ERC20 denoms prefix for IBC v2
2729

2830
### API-Breaking
2931

3032
- Refactored evmos/os into cosmos/evm
3133
- Renamed x/evm to x/vm
3234
- Renamed protobuf files from evmos to cosmos org
35+
- [\#95](https://github.com/cosmos/evm/pull/95) Updated ics20 precompile to use Denom instead of DenomTrace for IBC v2

ante/evm/utils_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
"github.com/cosmos/evm/testutil"
1515
utiltx "github.com/cosmos/evm/testutil/tx"
1616
evmtypes "github.com/cosmos/evm/x/vm/types"
17-
ibctypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
18-
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
17+
ibctypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
18+
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
1919

2020
sdkmath "cosmossdk.io/math"
2121
storetypes "cosmossdk.io/store/types"

cmd/evmd/cmd/root.go

+4-10
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
evmdconfig "github.com/cosmos/evm/cmd/evmd/config"
1818
cosmosevmkeyring "github.com/cosmos/evm/crypto/keyring"
1919
"github.com/cosmos/evm/evmd"
20+
"github.com/cosmos/evm/evmd/testutil"
2021
cosmosevmserver "github.com/cosmos/evm/server"
2122
cosmosevmserverconfig "github.com/cosmos/evm/server/config"
2223
srvflags "github.com/cosmos/evm/server/flags"
@@ -38,6 +39,7 @@ import (
3839
sdkserver "github.com/cosmos/cosmos-sdk/server"
3940
serverconfig "github.com/cosmos/cosmos-sdk/server/config"
4041
servertypes "github.com/cosmos/cosmos-sdk/server/types"
42+
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
4143
sdk "github.com/cosmos/cosmos-sdk/types"
4244
sdkmempool "github.com/cosmos/cosmos-sdk/types/mempool"
4345
sdktestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
@@ -49,14 +51,6 @@ import (
4951
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
5052
)
5153

52-
type emptyAppOptions struct{}
53-
54-
func (ao emptyAppOptions) Get(_ string) interface{} { return nil }
55-
56-
func NoOpEvmAppOptions(_ string) error {
57-
return nil
58-
}
59-
6054
// NewRootCmd creates a new root command for evmd. It is called once in the
6155
// main function.
6256
func NewRootCmd() *cobra.Command {
@@ -68,8 +62,8 @@ func NewRootCmd() *cobra.Command {
6862
dbm.NewMemDB(),
6963
nil,
7064
true,
71-
emptyAppOptions{},
72-
NoOpEvmAppOptions,
65+
simtestutil.EmptyAppOptions{},
66+
testutil.NoOpEvmAppOptions,
7367
)
7468

7569
encodingConfig := sdktestutil.TestEncodingConfig{

contracts/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

evmd/ante/cosmos_handler.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
cosmosante "github.com/cosmos/evm/ante/cosmos"
55
evmante "github.com/cosmos/evm/ante/evm"
66
evmtypes "github.com/cosmos/evm/x/vm/types"
7-
ibcante "github.com/cosmos/ibc-go/v8/modules/core/ante"
7+
ibcante "github.com/cosmos/ibc-go/v10/modules/core/ante"
88

99
sdk "github.com/cosmos/cosmos-sdk/types"
1010
"github.com/cosmos/cosmos-sdk/x/auth/ante"

evmd/ante/handler_options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package ante
22

33
import (
44
anteinterfaces "github.com/cosmos/evm/ante/interfaces"
5-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
5+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
66

77
errorsmod "cosmossdk.io/errors"
88
storetypes "cosmossdk.io/store/types"

evmd/app.go

+46-63
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ import (
2828
"github.com/cosmos/evm/x/erc20"
2929
erc20keeper "github.com/cosmos/evm/x/erc20/keeper"
3030
erc20types "github.com/cosmos/evm/x/erc20/types"
31+
erc20v2 "github.com/cosmos/evm/x/erc20/v2"
3132
"github.com/cosmos/evm/x/feemarket"
3233
feemarketkeeper "github.com/cosmos/evm/x/feemarket/keeper"
3334
feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
3435
// NOTE: override ICS20 keeper to support IBC transfers of ERC20 tokens
3536
"github.com/cosmos/evm/x/ibc/transfer"
3637
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
38+
transferv2 "github.com/cosmos/evm/x/ibc/transfer/v2"
3739
"github.com/cosmos/evm/x/vm"
3840
evmkeeper "github.com/cosmos/evm/x/vm/keeper"
3941
evmtypes "github.com/cosmos/evm/x/vm/types"
4042
"github.com/cosmos/gogoproto/proto"
41-
"github.com/cosmos/ibc-go/modules/capability"
42-
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
43-
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
44-
ibctransfer "github.com/cosmos/ibc-go/v8/modules/apps/transfer"
45-
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
46-
ibc "github.com/cosmos/ibc-go/v8/modules/core"
47-
ibcclienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
48-
ibcconnectiontypes "github.com/cosmos/ibc-go/v8/modules/core/03-connection/types"
49-
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
50-
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
51-
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
52-
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
53-
ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types"
43+
ibctransfer "github.com/cosmos/ibc-go/v10/modules/apps/transfer"
44+
ibctransfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
45+
ibc "github.com/cosmos/ibc-go/v10/modules/core"
46+
ibcclienttypes "github.com/cosmos/ibc-go/v10/modules/core/02-client/types"
47+
ibcconnectiontypes "github.com/cosmos/ibc-go/v10/modules/core/03-connection/types"
48+
porttypes "github.com/cosmos/ibc-go/v10/modules/core/05-port/types"
49+
ibcapi "github.com/cosmos/ibc-go/v10/modules/core/api"
50+
ibcexported "github.com/cosmos/ibc-go/v10/modules/core/exported"
51+
ibckeeper "github.com/cosmos/ibc-go/v10/modules/core/keeper"
52+
ibctm "github.com/cosmos/ibc-go/v10/modules/light-clients/07-tendermint"
53+
ibctesting "github.com/cosmos/ibc-go/v10/testing"
5454

5555
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
5656
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
@@ -167,11 +167,10 @@ var (
167167
var (
168168
_ runtime.AppI = (*EVMD)(nil)
169169
_ servertypes.Application = (*EVMD)(nil)
170+
_ ibctesting.TestingApp = (*EVMD)(nil)
170171
)
171172

172173
// EVMD extends an ABCI application, but with most of its parameters exported.
173-
// They are exported for convenience in creating helper functions, as object
174-
// capabilities aren't needed for testing.
175174
type EVMD struct {
176175
*baseapp.BaseApp
177176

@@ -188,7 +187,6 @@ type EVMD struct {
188187
// keepers
189188
AccountKeeper authkeeper.AccountKeeper
190189
BankKeeper bankkeeper.Keeper
191-
CapabilityKeeper *capabilitykeeper.Keeper
192190
StakingKeeper *stakingkeeper.Keeper
193191
SlashingKeeper slashingkeeper.Keeper
194192
MintKeeper mintkeeper.Keeper
@@ -202,10 +200,8 @@ type EVMD struct {
202200
ConsensusParamsKeeper consensusparamkeeper.Keeper
203201

204202
// IBC keepers
205-
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
206-
TransferKeeper transferkeeper.Keeper
207-
scopedIBCKeeper capabilitykeeper.ScopedKeeper
208-
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
203+
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
204+
TransferKeeper transferkeeper.Keeper
209205

210206
// Cosmos EVM keepers
211207
FeeMarketKeeper feemarketkeeper.Keeper
@@ -287,17 +283,15 @@ func NewExampleApp(
287283
keys := storetypes.NewKVStoreKeys(
288284
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
289285
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
290-
govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
291-
evidencetypes.StoreKey, capabilitytypes.StoreKey,
292-
authzkeeper.StoreKey,
286+
govtypes.StoreKey, paramstypes.StoreKey, consensusparamtypes.StoreKey,
287+
upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, authzkeeper.StoreKey,
293288
// ibc keys
294289
ibcexported.StoreKey, ibctransfertypes.StoreKey,
295290
// Cosmos EVM store keys
296291
evmtypes.StoreKey, feemarkettypes.StoreKey, erc20types.StoreKey,
297292
)
298293

299294
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey)
300-
memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
301295

302296
// load state streaming if enabled
303297
if err := bApp.RegisterStreamingServices(appOpts, keys); err != nil {
@@ -318,7 +312,6 @@ func NewExampleApp(
318312
interfaceRegistry: interfaceRegistry,
319313
keys: keys,
320314
tkeys: tkeys,
321-
memKeys: memKeys,
322315
}
323316

324317
app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
@@ -335,15 +328,6 @@ func NewExampleApp(
335328
)
336329
bApp.SetParamStore(app.ConsensusParamsKeeper.ParamsStore)
337330

338-
app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey])
339-
340-
app.scopedIBCKeeper = app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
341-
app.ScopedTransferKeeper = app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
342-
343-
// Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating
344-
// their scoped modules in `NewApp` with `ScopeToModule`
345-
app.CapabilityKeeper.Seal()
346-
347331
// add keepers
348332
app.AccountKeeper = authkeeper.NewAccountKeeper(
349333
appCodec, runtime.NewKVStoreService(keys[authtypes.StoreKey]),
@@ -449,11 +433,9 @@ func NewExampleApp(
449433
// Create IBC Keeper
450434
app.IBCKeeper = ibckeeper.NewKeeper(
451435
appCodec,
452-
keys[ibcexported.StoreKey],
436+
runtime.NewKVStoreService(keys[ibcexported.StoreKey]),
453437
app.GetSubspace(ibcexported.ModuleName),
454-
app.StakingKeeper,
455438
app.UpgradeKeeper,
456-
app.scopedIBCKeeper,
457439
authAddr,
458440
)
459441

@@ -522,17 +504,18 @@ func NewExampleApp(
522504

523505
// instantiate IBC transfer keeper AFTER the ERC-20 keeper to use it in the instantiation
524506
app.TransferKeeper = transferkeeper.NewKeeper(
525-
appCodec, keys[ibctransfertypes.StoreKey], app.GetSubspace(ibctransfertypes.ModuleName),
526-
nil, // we are passing no ics4 wrapper
527-
app.IBCKeeper.ChannelKeeper, app.IBCKeeper.PortKeeper,
528-
app.AccountKeeper, app.BankKeeper, app.ScopedTransferKeeper,
507+
appCodec,
508+
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
509+
app.GetSubspace(ibctransfertypes.ModuleName),
510+
app.IBCKeeper.ChannelKeeper,
511+
app.IBCKeeper.ChannelKeeper,
512+
app.MsgServiceRouter(),
513+
app.AccountKeeper,
514+
app.BankKeeper,
529515
app.Erc20Keeper, // Add ERC20 Keeper for ERC20 transfers
530516
authAddr,
531517
)
532518

533-
// Override the ICS20 app module
534-
transferModule := transfer.NewAppModule(app.TransferKeeper)
535-
536519
/*
537520
Create Transfer Stack
538521
@@ -553,11 +536,26 @@ func NewExampleApp(
553536
transferStack = transfer.NewIBCModule(app.TransferKeeper)
554537
transferStack = erc20.NewIBCMiddleware(app.Erc20Keeper, transferStack)
555538

539+
var transferStackV2 ibcapi.IBCModule
540+
transferStackV2 = transferv2.NewIBCModule(app.TransferKeeper)
541+
transferStackV2 = erc20v2.NewIBCMiddleware(transferStackV2, app.Erc20Keeper)
542+
556543
// Create static IBC router, add transfer route, then set and seal it
557544
ibcRouter := porttypes.NewRouter()
558545
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferStack)
546+
ibcRouterV2 := ibcapi.NewRouter()
547+
ibcRouterV2.AddRoute(ibctransfertypes.ModuleName, transferStackV2)
559548

560549
app.IBCKeeper.SetRouter(ibcRouter)
550+
app.IBCKeeper.SetRouterV2(ibcRouterV2)
551+
552+
clientKeeper := app.IBCKeeper.ClientKeeper
553+
storeProvider := app.IBCKeeper.ClientKeeper.GetStoreProvider()
554+
tmLightClientModule := ibctm.NewLightClientModule(appCodec, storeProvider)
555+
clientKeeper.AddRoute(ibctm.ModuleName, &tmLightClientModule)
556+
557+
// Override the ICS20 app module
558+
transferModule := transfer.NewAppModule(app.TransferKeeper)
561559

562560
// NOTE: we are adding all available Cosmos EVM EVM extensions.
563561
// Not all of them need to be enabled, which can be configured on a per-chain basis.
@@ -588,7 +586,6 @@ func NewExampleApp(
588586
),
589587
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
590588
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
591-
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
592589
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
593590
gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
594591
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
@@ -602,7 +599,7 @@ func NewExampleApp(
602599
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
603600
// IBC modules
604601
ibc.NewAppModule(app.IBCKeeper),
605-
ibctm.NewAppModule(),
602+
ibctm.NewAppModule(tmLightClientModule),
606603
transferModule,
607604
// Cosmos EVM modules
608605
vm.NewAppModule(app.EVMKeeper, app.AccountKeeper),
@@ -642,7 +639,7 @@ func NewExampleApp(
642639
// NOTE: staking module is required if HistoricalEntries param > 0
643640
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
644641
app.ModuleManager.SetOrderBeginBlockers(
645-
capabilitytypes.ModuleName, minttypes.ModuleName,
642+
minttypes.ModuleName,
646643

647644
// IBC modules
648645
ibcexported.ModuleName, ibctransfertypes.ModuleName,
@@ -663,7 +660,7 @@ func NewExampleApp(
663660
// to get the full block gas used.
664661
app.ModuleManager.SetOrderEndBlockers(
665662
govtypes.ModuleName, stakingtypes.ModuleName,
666-
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName,
663+
authtypes.ModuleName, banktypes.ModuleName,
667664

668665
// Cosmos EVM EndBlockers
669666
evmtypes.ModuleName, erc20types.ModuleName, feemarkettypes.ModuleName,
@@ -679,11 +676,8 @@ func NewExampleApp(
679676
// NOTE: The genutils module must occur after staking so that pools are
680677
// properly initialized with tokens from genesis accounts.
681678
// NOTE: The genutils module must also occur after auth so that it can access the params from auth.
682-
// NOTE: Capability module must occur first so that it can initialize any capabilities
683-
// so that other modules that want to create or claim capabilities afterwards in InitChain
684-
// can do so safely.
685679
genesisModuleOrder := []string{
686-
capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName,
680+
authtypes.ModuleName, banktypes.ModuleName,
687681
distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
688682
minttypes.ModuleName,
689683
ibcexported.ModuleName,
@@ -740,7 +734,6 @@ func NewExampleApp(
740734
// initialize stores
741735
app.MountKVStores(keys)
742736
app.MountTransientStores(tkeys)
743-
app.MountMemoryStores(memKeys)
744737

745738
maxGasWanted := cast.ToUint64(appOpts.Get(srvflags.EVMMaxTxGasWanted))
746739

@@ -1000,11 +993,6 @@ func (app *EVMD) GetBaseApp() *baseapp.BaseApp {
1000993
return app.BaseApp
1001994
}
1002995

1003-
// GetStakingKeeper implements the TestingApp interface.
1004-
func (app *EVMD) GetStakingKeeper() ibctestingtypes.StakingKeeper {
1005-
return app.StakingKeeper
1006-
}
1007-
1008996
// GetStakingKeeperSDK implements the TestingApp interface.
1009997
func (app *EVMD) GetStakingKeeperSDK() stakingkeeper.Keeper {
1010998
return *app.StakingKeeper
@@ -1015,11 +1003,6 @@ func (app *EVMD) GetIBCKeeper() *ibckeeper.Keeper {
10151003
return app.IBCKeeper
10161004
}
10171005

1018-
// GetScopedIBCKeeper implements the TestingApp interface.
1019-
func (app *EVMD) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper {
1020-
return app.scopedIBCKeeper
1021-
}
1022-
10231006
// GetTxConfig implements the TestingApp interface.
10241007
func (app *EVMD) GetTxConfig() client.TxConfig {
10251008
return app.txConfig

evmd/config_testing.go

+12
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import (
88
"strings"
99

1010
"cosmossdk.io/math"
11+
1112
sdk "github.com/cosmos/cosmos-sdk/types"
13+
1214
testconstants "github.com/cosmos/evm/testutil/constants"
1315
evmtypes "github.com/cosmos/evm/x/vm/types"
1416
)
@@ -27,6 +29,16 @@ var ChainsCoinInfo = map[string]evmtypes.EvmCoinInfo{
2729
DisplayDenom: testconstants.ExampleDisplayDenom,
2830
Decimals: evmtypes.SixDecimals,
2931
},
32+
TestChainID1: {
33+
Denom: ExampleChainDenom,
34+
DisplayDenom: ExampleChainDenom,
35+
Decimals: evmtypes.EighteenDecimals,
36+
},
37+
TestChainID2: {
38+
Denom: ExampleChainDenom,
39+
DisplayDenom: ExampleChainDenom,
40+
Decimals: evmtypes.EighteenDecimals,
41+
},
3042
}
3143

3244
// EVMOptionsFn defines a function type for setting app options specifically for

0 commit comments

Comments
 (0)