Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup expected keepers #1754

Merged
merged 10 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
67 changes: 34 additions & 33 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,27 +226,27 @@ type App struct {
memKeys map[string]*storetypes.MemoryStoreKey

// keepers
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
ZetaCoreKeeper crosschainkeeper.Keeper
ZetaObserverKeeper *observerkeeper.Keeper
mm *module.Manager
sm *module.SimulationManager
configurator module.Configurator
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
FungibleKeeper fungibleModuleKeeper.Keeper
EmissionsKeeper emissionsModuleKeeper.Keeper
GroupKeeper groupkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
EvidenceKeeper evidencekeeper.Keeper
CrosschainKeeper crosschainkeeper.Keeper
ObserverKeeper *observerkeeper.Keeper
mm *module.Manager
sm *module.SimulationManager
configurator module.Configurator
EvmKeeper *evmkeeper.Keeper
FeeMarketKeeper feemarketkeeper.Keeper
FungibleKeeper fungibleModuleKeeper.Keeper
EmissionsKeeper emissionsModuleKeeper.Keeper
GroupKeeper groupkeeper.Keeper
AuthzKeeper authzkeeper.Keeper
}

// New returns a reference to an initialized ZetaApp.
Expand Down Expand Up @@ -336,7 +336,7 @@ func New(
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp,
authtypes.NewModuleAddress(govtypes.ModuleName).String())

app.ZetaObserverKeeper = observerkeeper.NewKeeper(
app.ObserverKeeper = observerkeeper.NewKeeper(
appCodec,
keys[observertypes.StoreKey],
keys[observertypes.MemStoreKey],
Expand All @@ -348,7 +348,7 @@ func New(
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper = *stakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks(), app.ZetaObserverKeeper.Hooks()),
stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks(), app.ObserverKeeper.Hooks()),
)

app.AuthzKeeper = authzkeeper.NewKeeper(
Expand All @@ -365,7 +365,8 @@ func New(
authtypes.FeeCollectorName,
app.BankKeeper,
app.StakingKeeper,
app.ZetaObserverKeeper,
app.ObserverKeeper,
app.AccountKeeper,
)
// Create Ethermint keepers
tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer))
Expand All @@ -391,18 +392,18 @@ func New(
app.AccountKeeper,
app.EvmKeeper,
app.BankKeeper,
app.ZetaObserverKeeper,
app.ObserverKeeper,
)

app.ZetaCoreKeeper = *crosschainkeeper.NewKeeper(
app.CrosschainKeeper = *crosschainkeeper.NewKeeper(
appCodec,
keys[crosschaintypes.StoreKey],
keys[crosschaintypes.MemStoreKey],
&stakingKeeper,
app.GetSubspace(crosschaintypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.ZetaObserverKeeper,
app.ObserverKeeper,
&app.FungibleKeeper,
)
app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, group.Config{
Expand Down Expand Up @@ -442,7 +443,7 @@ func New(
app.EvidenceKeeper = *evidenceKeeper

app.EvmKeeper = app.EvmKeeper.SetHooks(evmkeeper.NewMultiEvmHooks(
app.ZetaCoreKeeper.Hooks(),
app.CrosschainKeeper.Hooks(),
app.FungibleKeeper.EVMHooks(),
))

Expand Down Expand Up @@ -474,10 +475,10 @@ func New(
groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, interfaceRegistry),
evm.NewAppModule(app.EvmKeeper, app.AccountKeeper, evmSs),
feemarket.NewAppModule(app.FeeMarketKeeper, feeSs),
crosschainmodule.NewAppModule(appCodec, app.ZetaCoreKeeper, app.StakingKeeper, app.AccountKeeper),
observermodule.NewAppModule(appCodec, *app.ZetaObserverKeeper, app.AccountKeeper, app.BankKeeper),
fungibleModule.NewAppModule(appCodec, app.FungibleKeeper, app.AccountKeeper, app.BankKeeper),
emissionsModule.NewAppModule(appCodec, app.EmissionsKeeper, app.AccountKeeper),
crosschainmodule.NewAppModule(appCodec, app.CrosschainKeeper),
observermodule.NewAppModule(appCodec, *app.ObserverKeeper),
fungibleModule.NewAppModule(appCodec, app.FungibleKeeper),
emissionsModule.NewAppModule(appCodec, app.EmissionsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
)

Expand Down Expand Up @@ -589,7 +590,7 @@ func New(
sdk.MsgTypeURL(&vestingtypes.MsgCreatePermanentLockedAccount{}),
sdk.MsgTypeURL(&vestingtypes.MsgCreatePeriodicVestingAccount{}),
},
ObserverKeeper: app.ZetaObserverKeeper,
ObserverKeeper: app.ObserverKeeper,
}

anteHandler, err := ante.NewAnteHandler(options)
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
### Chores

* [1729](https://github.com/zeta-chain/node/pull/1729) - add issue templates
* [1754](https://github.com/zeta-chain/node/pull/1754) - cleanup expected keepers

## Version: v12.2.4

Expand Down
2 changes: 2 additions & 0 deletions testutil/keeper/emissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/store"
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"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
typesparams "github.com/cosmos/cosmos-sdk/x/params/types"
Expand Down Expand Up @@ -49,6 +50,7 @@ func EmissionsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {
bankkeeper.BaseKeeper{},
stakingkeeper.Keeper{},
observerkeeper.Keeper{},
authkeeper.AccountKeeper{},
)

ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger())
Expand Down
47 changes: 1 addition & 46 deletions testutil/keeper/mocks/crosschain/account.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 1 addition & 115 deletions testutil/keeper/mocks/crosschain/bank.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 1 addition & 31 deletions testutil/keeper/mocks/crosschain/fungible.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading