Is there an existing issue for this?
What happened?
A bug happened!
A bank keeper was recently added to both the feegrant and authz keepers. In order to not be a breaking change, a SetBankKeeper method was added to both keepers and that method is called in NewAppModule for both modules.
However, the bank keeper is remaining nil in both keepers used by an app.
There are two problems:
- The receivers for the
SetBankKeeper methods are concrete. So it's actually creating a copy of the keeper struct, changing the bank keeper field in the new one, and returning the new one. It doesn't actually update the original keeper.
- The keepers are being provided to the
NewAppModule functions as their struct (not a reference). So any changes made to the keeper inside NewAppModule do not affect the keeper that was provided to that function. The module struct will have a copy of the keeper that has the bank module set in it, but the keeper that's in the app (being provided to other keepers and modules) does not have the bank keeper.
Cosmos SDK Version
0.50.7
How to reproduce?
No response
Is there an existing issue for this?
What happened?
A bug happened!
A bank keeper was recently added to both the feegrant and authz keepers. In order to not be a breaking change, a
SetBankKeepermethod was added to both keepers and that method is called inNewAppModulefor both modules.However, the bank keeper is remaining nil in both keepers used by an app.
There are two problems:
SetBankKeepermethods are concrete. So it's actually creating a copy of the keeper struct, changing the bank keeper field in the new one, and returning the new one. It doesn't actually update the original keeper.NewAppModulefunctions as their struct (not a reference). So any changes made to the keeper insideNewAppModuledo not affect the keeper that was provided to that function. The module struct will have a copy of the keeper that has the bank module set in it, but the keeper that's in the app (being provided to other keepers and modules) does not have the bank keeper.Cosmos SDK Version
0.50.7
How to reproduce?
No response