diff --git a/x/bank/module.go b/x/bank/module.go index 4427175cc58..38725e71ee9 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -25,12 +25,14 @@ 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. @@ -231,7 +233,7 @@ type bankInputs struct { Key *store.KVStoreKey AccountKeeper types.AccountKeeper - Authority types.Authority + Authority types.Authority `optional:"true"` // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace @@ -261,12 +263,18 @@ func provideModule(in bankInputs) bankOutputs { } } + authority := in.Authority + if authority == nil || len(authority) == 0 { + // default to governance authority if not provided + authority = types.Authority(authtypes.NewModuleAddress(govtypes.ModuleName)) + } + bankKeeper := keeper.NewBaseKeeper( in.Cdc, in.Key, in.AccountKeeper, blockedAddresses, - in.Authority.String(), + authority.String(), ) m := NewAppModule(in.Cdc, bankKeeper, in.AccountKeeper, in.LegacySubspace)