Skip to content

Commit

Permalink
feat: use ethermint auth & remove xpla evm
Browse files Browse the repository at this point in the history
  • Loading branch information
JoowonYun committed Apr 22, 2024
1 parent a7eca6c commit 259dc2b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 99 deletions.
6 changes: 3 additions & 3 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/cosmos/cosmos-sdk/store/streaming"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
Expand Down Expand Up @@ -73,6 +72,7 @@ import (
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"

etherminttypes "github.com/xpladev/ethermint/types"
ethermintauthkeeper "github.com/xpladev/ethermint/x/auth/keeper"
"github.com/xpladev/ethermint/x/erc20"
erc20keeper "github.com/xpladev/ethermint/x/erc20/keeper"
erc20types "github.com/xpladev/ethermint/x/erc20/types"
Expand All @@ -95,7 +95,7 @@ type AppKeepers struct {
memKeys map[string]*storetypes.MemoryStoreKey

// keepers
AccountKeeper authkeeper.AccountKeeper
AccountKeeper ethermintauthkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper *xplastakingkeeper.Keeper
Expand Down Expand Up @@ -206,7 +206,7 @@ func NewAppKeeper(
)

// add normal keepers
appKeepers.AccountKeeper = authkeeper.NewAccountKeeper(
appKeepers.AccountKeeper = ethermintauthkeeper.NewAccountKeeper(
appCodec,
appKeepers.keys[authtypes.StoreKey],
etherminttypes.ProtoAccount,
Expand Down
8 changes: 4 additions & 4 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import (
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"

ethermintauth "github.com/xpladev/ethermint/x/auth"
"github.com/xpladev/ethermint/x/erc20"
erc20client "github.com/xpladev/ethermint/x/erc20/client"
erc20types "github.com/xpladev/ethermint/x/erc20/types"
Expand All @@ -64,7 +65,6 @@ import (
"github.com/xpladev/ethermint/x/feemarket"
feemarkettypes "github.com/xpladev/ethermint/x/feemarket/types"
xplaparams "github.com/xpladev/xpla/app/params"
xplaevm "github.com/xpladev/xpla/x/evm"
"github.com/xpladev/xpla/x/reward"
rewardtypes "github.com/xpladev/xpla/x/reward/types"
xplastaking "github.com/xpladev/xpla/x/staking"
Expand Down Expand Up @@ -153,8 +153,8 @@ func appModules(
app.BaseApp.DeliverTx,
encodingConfig.TxConfig,
),
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
ethermintauth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
vesting.NewAppModule(app.AccountKeeper.AccountKeeper, app.BankKeeper),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)),
Expand All @@ -175,7 +175,7 @@ func appModules(
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
router.NewAppModule(app.PFMRouterKeeper, app.GetSubspace(pfmroutertypes.ModuleName)),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
xplaevm.NewAppModule(app.EvmKeeper, app.AccountKeeper, app.GetSubspace(evmtypes.ModuleName)),
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, app.GetSubspace(evmtypes.ModuleName)),
feemarket.NewAppModule(app.FeeMarketKeeper, app.GetSubspace(feemarkettypes.ModuleName)),
erc20.NewAppModule(app.Erc20Keeper, app.AccountKeeper, app.GetSubspace(erc20types.ModuleName)),
reward.NewAppModule(appCodec, app.RewardKeeper, app.BankKeeper, app.StakingKeeper, app.DistrKeeper, app.GetSubspace(rewardtypes.ModuleName)),
Expand Down
2 changes: 1 addition & 1 deletion app/upgrades/v1_4/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func CreateUpgradeHandler(
cdc codec.BinaryCodec,
) upgradetypes.UpgradeHandler {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
authKeeper := keepers.AccountKeeper
authKeeper := keepers.AccountKeeper.AccountKeeper
stakingKeeper := keepers.StakingKeeper

migrateBaseAccountToEthAccount(ctx, authKeeper)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.18.2
github.com/stretchr/testify v1.8.4
github.com/xpladev/ethermint v0.23.0-xpla
github.com/xpladev/ethermint v0.23.0-xpla-1
golang.org/x/sync v0.6.0
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80
google.golang.org/grpc v1.62.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
github.com/xpladev/cosmos-sdk v0.47.10-xpla h1:7zbtoMCBGYlPUzz+2+nDHW7sSvnHlJknorAZfd7bwfc=
github.com/xpladev/cosmos-sdk v0.47.10-xpla/go.mod h1:WjqTUUHJnaRjkgJbP2aQ1F+9pxDpLsOBpfuP2S0W+Ck=
github.com/xpladev/ethermint v0.23.0-xpla h1:ON4gzO39qauL7OUEmgJUw9Tc6zmtqe3h2oYAczdolIg=
github.com/xpladev/ethermint v0.23.0-xpla/go.mod h1:cAx0S0XxPKY0enn4nufgaJIxtHEM51UXFOrOS3aEDwA=
github.com/xpladev/ethermint v0.23.0-xpla-1 h1:OqNfa59QUm6uNvn1eAvoZcAqqq4gTMqtOL72tw424tQ=
github.com/xpladev/ethermint v0.23.0-xpla-1/go.mod h1:cAx0S0XxPKY0enn4nufgaJIxtHEM51UXFOrOS3aEDwA=
github.com/xpladev/go-ethereum v1.10.26-xpla h1:tz9WTV9Fhhu9Xcpxo7RcXBygKcUbb5Zps4PBOVFgRqQ=
github.com/xpladev/go-ethereum v1.10.26-xpla/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg=
github.com/xpladev/ledger-cosmos-go v0.12.2-xpla h1:+3moDTh8sybPd1CtdNNNFlJS78vuUCvGxvxDiitt2yg=
Expand Down
46 changes: 0 additions & 46 deletions x/evm/genesis.go

This file was deleted.

42 changes: 0 additions & 42 deletions x/evm/module.go

This file was deleted.

0 comments on commit 259dc2b

Please sign in to comment.