From 978e09c07b80cb69f2e55fa72e8e82b518e579b4 Mon Sep 17 00:00:00 2001 From: Hanjun Kim Date: Fri, 17 May 2024 05:12:07 +0900 Subject: [PATCH] fix: adjust keeper initialization order --- app/app.go | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/app/app.go b/app/app.go index d2592398..b993d828 100644 --- a/app/app.go +++ b/app/app.go @@ -566,33 +566,6 @@ func NewMilkApp( *app.IBCKeeper, ) - app.RecordsKeeper = *recordskeeper.NewKeeper( - appCodec, - keys[recordstypes.StoreKey], - keys[recordstypes.MemStoreKey], - app.GetSubspace(recordstypes.ModuleName), - app.AccountKeeper, - *app.TransferKeeper, - *app.IBCKeeper, - app.ICACallbacksKeeper, - ) - - app.StakeIBCKeeper = stakeibckeeper.NewKeeper( - appCodec, - keys[stakeibctypes.StoreKey], - keys[stakeibctypes.MemStoreKey], - app.GetSubspace(stakeibctypes.ModuleName), - authorityAddr, - app.AccountKeeper, - app.BankKeeper, - *app.ICAControllerKeeper, - *app.IBCKeeper, - app.InterchainQueryKeeper, - app.RecordsKeeper, - app.ICACallbacksKeeper, - app.RateLimitKeeper, - ) - epochsKeeper := epochskeeper.NewKeeper(appCodec, keys[epochstypes.StoreKey]) app.EpochsKeeper = *epochsKeeper.SetHooks( epochstypes.NewMultiEpochHooks( @@ -680,6 +653,17 @@ func NewMilkApp( ) transferStack = ratelimit.NewIBCMiddleware(app.RateLimitKeeper, transferStack) + + app.RecordsKeeper = *recordskeeper.NewKeeper( + appCodec, + keys[recordstypes.StoreKey], + keys[recordstypes.MemStoreKey], + app.GetSubspace(recordstypes.ModuleName), + app.AccountKeeper, + *app.TransferKeeper, + *app.IBCKeeper, + app.ICACallbacksKeeper, + ) transferStack = records.NewIBCModule(app.RecordsKeeper, transferStack) // create ibcfee middleware for transfer @@ -740,6 +724,22 @@ func NewMilkApp( icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerIBCModule, *app.IBCFeeKeeper) icaCallbacksStack = icacallbacks.NewIBCModule(app.ICACallbacksKeeper) + + app.StakeIBCKeeper = stakeibckeeper.NewKeeper( + appCodec, + keys[stakeibctypes.StoreKey], + keys[stakeibctypes.MemStoreKey], + app.GetSubspace(stakeibctypes.ModuleName), + authorityAddr, + app.AccountKeeper, + app.BankKeeper, + *app.ICAControllerKeeper, + *app.IBCKeeper, + app.InterchainQueryKeeper, + app.RecordsKeeper, + app.ICACallbacksKeeper, + app.RateLimitKeeper, + ) icaCallbacksStack = stakeibc.NewIBCMiddleware(icaCallbacksStack, app.StakeIBCKeeper) icaCallbacksStack = icacontroller.NewIBCMiddleware(icaCallbacksStack, *app.ICAControllerKeeper) icaCallbacksStack = ibcfee.NewIBCMiddleware(icaCallbacksStack, *app.IBCFeeKeeper)