From 647907de0dc3ba5153a359032ea2144d49b58b3d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:24:38 +0000 Subject: [PATCH] refactor(x/authz,x/feegrant): provide updated keeper in depinject (backport #20590) (#20595) Co-authored-by: Julien Robert --- CHANGELOG.md | 4 ++++ x/authz/module/module.go | 2 +- x/feegrant/module/module.go | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7791411be3f5..cc0f3029ed20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## Improvements + +* (x/authz,x/feegrant) [#20590](https://github.com/cosmos/cosmos-sdk/pull/20590) Provide updated keeper in depinject for authz and feegrant modules. + ## [v0.47.11](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.11) - 2024-04-22 ### Bug Fixes diff --git a/x/authz/module/module.go b/x/authz/module/module.go index 50c91ddc4269..c75fdc9bd080 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -192,7 +192,7 @@ type AuthzOutputs struct { func ProvideModule(in AuthzInputs) AuthzOutputs { k := keeper.NewKeeper(in.Key, in.Cdc, in.MsgServiceRouter, in.AccountKeeper) m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.Registry) - return AuthzOutputs{AuthzKeeper: k, Module: m} + return AuthzOutputs{AuthzKeeper: k.SetBankKeeper(in.BankKeeper) /* depinject ux improvement */, Module: m} } // ____________________________________________________________________________ diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 454f9a8f5291..00038054d462 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -121,7 +121,7 @@ type AppModule struct { func NewAppModule(cdc codec.Codec, ak feegrant.AccountKeeper, bk feegrant.BankKeeper, keeper keeper.Keeper, registry cdctypes.InterfaceRegistry) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc}, - keeper: keeper.SetBankKeeper(bk), // Super ugly hack to not be api breaking in v0.50 and v0.47, + keeper: keeper.SetBankKeeper(bk), // Super ugly hack to not be api breaking in v0.50 and v0.47 accountKeeper: ak, bankKeeper: bk, registry: registry, @@ -197,7 +197,7 @@ type FeegrantInputs struct { func ProvideModule(in FeegrantInputs) (keeper.Keeper, appmodule.AppModule) { k := keeper.NewKeeper(in.Cdc, in.Key, in.AccountKeeper) m := NewAppModule(in.Cdc, in.AccountKeeper, in.BankKeeper, k, in.Registry) - return k, m + return k.SetBankKeeper(in.BankKeeper) /* depinject ux improvement */, m } // AppModuleSimulation functions