From e09844bed3dd6bf2fae2ff6f08ea424479d8bd16 Mon Sep 17 00:00:00 2001 From: Vladislav Mikitich Date: Tue, 5 Mar 2024 13:01:22 +0300 Subject: [PATCH] ibc-transfer account creation fix --- app/app.go | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/app.go b/app/app.go index 6b68138..767e8d7 100644 --- a/app/app.go +++ b/app/app.go @@ -432,6 +432,15 @@ func New( // ... other modules keepers + app.ScorumKeeper = scorumkeeper.NewKeeper( + appCodec, + keys[scorumtypes.StoreKey], + app.GetSubspace(scorumtypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + authtypes.FeeCollectorName, + ) + // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( appCodec, keys[ibchost.StoreKey], @@ -441,6 +450,16 @@ func New( scopedIBCKeeper, ) + // create keeper wrappers to mint gas + scorumWrapperAccountKeeper := scorumwrapper.NewAccountKeeper(app.AccountKeeper, app.BankKeeper, app.ScorumKeeper) + scorumWrapperBankKeeper := bankkeeper.NewBaseKeeper( + appCodec, + keys[banktypes.StoreKey], + scorumWrapperAccountKeeper, + app.GetSubspace(banktypes.ModuleName), + app.BlockedModuleAccountAddrs(), + ) + // Create Transfer Keepers app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, @@ -449,8 +468,8 @@ func New( app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - scorumwrapper.NewAccountKeeper(app.AccountKeeper, app.BankKeeper, app.ScorumKeeper), - app.BankKeeper, + scorumWrapperAccountKeeper, + scorumWrapperBankKeeper, scopedTransferKeeper, ) transferModule := transfer.NewAppModule(app.TransferKeeper) @@ -462,7 +481,7 @@ func New( app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, - scorumwrapper.NewAccountKeeper(app.AccountKeeper, app.BankKeeper, app.ScorumKeeper), + scorumWrapperAccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), ) @@ -493,14 +512,6 @@ func New( app.BankKeeper, ) - app.ScorumKeeper = scorumkeeper.NewKeeper( - appCodec, - keys[scorumtypes.StoreKey], - app.GetSubspace(scorumtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - authtypes.FeeCollectorName, - ) scorumModule := scorum.NewAppModule(appCodec, app.ScorumKeeper, app.AccountKeeper, app.BankKeeper) app.AviatrixKeeper = aviatrixkeeper.NewKeeper(