diff --git a/simapp/app.go b/simapp/app.go index 34432a1aac98..0ea122e72354 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -193,8 +193,17 @@ func NewSimApp( app = &SimApp{} appBuilder *runtime.AppBuilder + // authorities definition + bankAuthority = banktypes.Authority(authtypes.NewModuleAddress(govtypes.ModuleName)) + // merge the app.yaml and the appOpts in one config - appConfig = depinject.Configs(AppConfig, depinject.Supply(appOpts)) + appConfig = depinject.Configs( + AppConfig, + depinject.Supply( + appOpts, + bankAuthority, + ), + ) ) if err := depinject.Inject(appConfig, diff --git a/x/bank/module.go b/x/bank/module.go index ff0c02aeeb8e..4427175cc587 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -25,14 +25,12 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/client/cli" "github.com/cosmos/cosmos-sdk/x/bank/exported" "github.com/cosmos/cosmos-sdk/x/bank/keeper" v1bank "github.com/cosmos/cosmos-sdk/x/bank/migrations/v1" "github.com/cosmos/cosmos-sdk/x/bank/simulation" "github.com/cosmos/cosmos-sdk/x/bank/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) // ConsensusVersion defines the current x/bank module consensus version. @@ -233,6 +231,7 @@ type bankInputs struct { Key *store.KVStoreKey AccountKeeper types.AccountKeeper + Authority types.Authority // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace @@ -267,8 +266,9 @@ func provideModule(in bankInputs) bankOutputs { in.Key, in.AccountKeeper, blockedAddresses, - authtypes.NewModuleAddress(govtypes.ModuleName).String(), + in.Authority.String(), ) m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper, in.LegacySubspace) + return bankOutputs{BankKeeper: bankKeeper, Module: runtime.WrapAppModule(m)} } diff --git a/x/bank/types/authority.go b/x/bank/types/authority.go new file mode 100644 index 000000000000..e58987bd8827 --- /dev/null +++ b/x/bank/types/authority.go @@ -0,0 +1,11 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +type Authority sdk.AccAddress + +func (a Authority) String() string { + return sdk.AccAddress(a).String() +}