diff --git a/simapp/app.go b/simapp/app.go index 44a2f5e6e1..bb5328e993 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -197,16 +197,29 @@ func NewSimApp( // supply the application options appOpts, + // ADVANCED CONFIGURATION + + // + // AUTH + // + + // For providing a custom function required in auth to generate custom account types + // add it below. By default the auth module uses simulation.RandomGenesisAccounts. + // + // authtypes.RandomGenesisAccountsFn(simulation.RandomGenesisAccounts), + + // For providing a custom a base account type add it below. + // By default the auth module uses authtypes.ProtoBaseAccount(). + // + // func() authtypes.AccountI { return authtypes.ProtoBaseAccount() }, + + // + // MINT + // + // For providing a custom inflation function for x/mint add here your // custom function that implements the minttypes.InflationCalculationFn // interface. - - // For providing a custom authority to a module simply add it below. By - // default the governance module is the default authority. - // - // map[string]sdk.AccAddress{ - // minttypes.ModuleName: authtypes.NewModuleAddress(authtypes.ModuleName), - // }, ), ) ) diff --git a/simapp/app_config.go b/simapp/app_config.go index 4bd7a15489..8a08ccbc44 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -140,6 +140,9 @@ var ( Config: appconfig.WrapAny(&authmodulev1.Module{ Bech32Prefix: "cosmos", ModuleAccountPermissions: moduleAccPerms, + // By default modules authority is the governance module. This is configurable with the following: + // Authority: "group", // A custom module authority can be set using a module name + // Authority: "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv", // or a specific address }), }, { diff --git a/x/auth/module.go b/x/auth/module.go index bb23bfd771..7f5c834619 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -179,7 +179,7 @@ func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weighte } // -// New App Wiring Setup +// App Wiring Setup // func init() { @@ -199,6 +199,9 @@ type AuthInputs struct { Key *store.KVStoreKey Cdc codec.Codec + RandomGenesisAccountsFn types.RandomGenesisAccountsFn `optional:"true"` + AccountI func() types.AccountI `optional:"true"` + // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace `optional:"true"` } @@ -216,8 +219,22 @@ func ProvideModule(in AuthInputs) AuthOutputs { maccPerms[permission.Account] = permission.Permissions } - k := keeper.NewAccountKeeper(in.Cdc, in.Key, types.ProtoBaseAccount, maccPerms, in.Config.Bech32Prefix, types.NewModuleAddress(govtypes.ModuleName).String()) - m := NewAppModule(in.Cdc, k, simulation.RandomGenesisAccounts, in.LegacySubspace) + // default to governance authority if not provided + authority := types.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = types.NewModuleAddressOrBech32Address(in.Config.Authority) + } + + if in.RandomGenesisAccountsFn == nil { + in.RandomGenesisAccountsFn = simulation.RandomGenesisAccounts + } + + if in.AccountI == nil { + in.AccountI = types.ProtoBaseAccount + } + + k := keeper.NewAccountKeeper(in.Cdc, in.Key, in.AccountI, maccPerms, in.Config.Bech32Prefix, authority.String()) + m := NewAppModule(in.Cdc, k, in.RandomGenesisAccountsFn, in.LegacySubspace) return AuthOutputs{AccountKeeper: k, Module: runtime.WrapAppModule(m)} } diff --git a/x/auth/types/account.go b/x/auth/types/account.go index 3b8dfee7a4..d1169e5260 100644 --- a/x/auth/types/account.go +++ b/x/auth/types/account.go @@ -160,6 +160,17 @@ func (acc BaseAccount) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { return unpacker.UnpackAny(acc.PubKey, &pubKey) } +// NewModuleAddressOrAddress gets an input string and returns an AccAddress. +// If the input is a valid address, it returns the address. +// If the input is a module name, it returns the module address. +func NewModuleAddressOrBech32Address(input string) sdk.AccAddress { + if addr, err := sdk.AccAddressFromBech32(input); err == nil { + return addr + } + + return NewModuleAddress(input) +} + // NewModuleAddress creates an AccAddress from the hash of the module's name func NewModuleAddress(name string) sdk.AccAddress { return sdk.AccAddress(crypto.AddressHash([]byte(name))) diff --git a/x/auth/types/account_test.go b/x/auth/types/account_test.go index 20a045bbb8..571dc2ec90 100644 --- a/x/auth/types/account_test.go +++ b/x/auth/types/account_test.go @@ -214,3 +214,9 @@ func TestGenesisAccountsContains(t *testing.T) { genAccounts = append(genAccounts, acc) require.True(t, genAccounts.Contains(acc.GetAddress())) } + +func TestNewModuleAddressOrBech32Address(t *testing.T) { + input := "cosmos1cwwv22j5ca08ggdv9c2uky355k908694z577tv" + require.Equal(t, input, types.NewModuleAddressOrBech32Address(input).String()) + require.Equal(t, "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", types.NewModuleAddressOrBech32Address("distribution").String()) +} diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 8dcb4a09ad..71439a6a0f 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -111,7 +111,7 @@ func (am AppModule) ExportGenesis(_ sdk.Context, cdc codec.JSONCodec) json.RawMe func (AppModule) ConsensusVersion() uint64 { return 1 } // -// New App Wiring Setup +// App Wiring Setup // func init() { diff --git a/x/bank/module.go b/x/bank/module.go index bfb20c8cdc..70d3ec4a33 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -192,7 +192,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp ) } -// New App Wiring Setup +// App Wiring Setup func init() { appmodule.Register(&modulev1.Module{}, @@ -208,13 +208,11 @@ func ProvideModuleBasic() runtime.AppModuleBasicWrapper { type BankInputs struct { depinject.In - ModuleKey depinject.OwnModuleKey - Config *modulev1.Module - Cdc codec.Codec - Key *store.KVStoreKey + Config *modulev1.Module + Cdc codec.Codec + Key *store.KVStoreKey AccountKeeper types.AccountKeeper - Authority map[string]sdk.AccAddress `optional:"true"` // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace `optional:"true"` @@ -244,10 +242,10 @@ func ProvideModule(in BankInputs) BankOutputs { } } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } bankKeeper := keeper.NewBaseKeeper( diff --git a/x/capability/module.go b/x/capability/module.go index 688086a4e2..510dfa00d6 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -170,7 +170,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp } // -// New App Wiring Setup +// App Wiring Setup // func init() { diff --git a/x/consensus/module.go b/x/consensus/module.go index 6dcef77d93..b79317690b 100644 --- a/x/consensus/module.go +++ b/x/consensus/module.go @@ -134,10 +134,9 @@ func ProvideModuleBasic() runtime.AppModuleBasicWrapper { type ConsensusParamInputs struct { depinject.In - Cdc codec.Codec - Key *store.KVStoreKey - ModuleKey depinject.OwnModuleKey - Authority map[string]sdk.AccAddress `optional:"true"` + Config *modulev1.Module + Cdc codec.Codec + Key *store.KVStoreKey } type ConsensusParamOutputs struct { @@ -149,10 +148,10 @@ type ConsensusParamOutputs struct { } func ProvideModule(in ConsensusParamInputs) ConsensusParamOutputs { - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper(in.Cdc, in.Key, authority.String()) diff --git a/x/crisis/module.go b/x/crisis/module.go index 756fdf9ae8..292fb0f244 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -175,7 +175,7 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val return []abci.ValidatorUpdate{} } -// New App Wiring Setup +// App Wiring Setup func init() { appmodule.Register( @@ -187,12 +187,10 @@ func init() { type CrisisInputs struct { depinject.In - ModuleKey depinject.OwnModuleKey - Config *modulev1.Module - Key *store.KVStoreKey - Cdc codec.Codec - AppOpts servertypes.AppOptions `optional:"true"` - Authority map[string]sdk.AccAddress `optional:"true"` + Config *modulev1.Module + Key *store.KVStoreKey + Cdc codec.Codec + AppOpts servertypes.AppOptions `optional:"true"` BankKeeper types.SupplyKeeper @@ -222,10 +220,10 @@ func ProvideModule(in CrisisInputs) CrisisOutputs { feeCollectorName = authtypes.FeeCollectorName } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( diff --git a/x/distribution/module.go b/x/distribution/module.go index 022638a30a..211c56d9cd 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -196,7 +196,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp } // -// New App Wiring Setup +// App Wiring Setup // func init() { @@ -212,11 +212,9 @@ func ProvideModuleBasic() runtime.AppModuleBasicWrapper { type DistrInputs struct { depinject.In - ModuleKey depinject.OwnModuleKey - Config *modulev1.Module - Key *store.KVStoreKey - Cdc codec.Codec - Authority map[string]sdk.AccAddress `optional:"true"` + Config *modulev1.Module + Key *store.KVStoreKey + Cdc codec.Codec AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper @@ -240,10 +238,10 @@ func ProvideModule(in DistrInputs) DistrOutputs { feeCollectorName = authtypes.FeeCollectorName } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( diff --git a/x/evidence/module.go b/x/evidence/module.go index 419a0f36dc..a777b15e6b 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -185,7 +185,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp } // -// New App Wiring Setup +// App Wiring Setup // func init() { diff --git a/x/gov/module.go b/x/gov/module.go index 42fbc5cd8f..c6f54f1631 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -166,7 +166,6 @@ type GovInputs struct { Key *store.KVStoreKey ModuleKey depinject.OwnModuleKey MsgServiceRouter *baseapp.MsgServiceRouter - Authority map[string]sdk.AccAddress `optional:"true"` AccountKeeper govtypes.AccountKeeper BankKeeper govtypes.BankKeeper @@ -190,9 +189,10 @@ func ProvideModule(in GovInputs) GovOutputs { kConfig.MaxMetadataLen = in.Config.MaxMetadataLen } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( diff --git a/x/group/module/module.go b/x/group/module/module.go index 528eaf4c91..89fe103a6c 100644 --- a/x/group/module/module.go +++ b/x/group/module/module.go @@ -148,6 +148,39 @@ func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.Val return []abci.ValidatorUpdate{} } +// ____________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the group module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// ProposalContents returns all the group content functions used to +// simulate governance proposals. +func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RegisterStoreDecoder registers a decoder for group module's types +func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { + sdr[group.StoreKey] = simulation.NewDecodeStore(am.cdc) +} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + return simulation.WeightedOperations( + am.registry, + simState.AppParams, simState.Cdc, + am.accKeeper, am.bankKeeper, am.keeper, am.cdc, + ) +} + +// +// App Wiring Setup +// + func init() { appmodule.Register( &modulev1.Module{}, @@ -192,32 +225,3 @@ func ProvideModule(in GroupInputs) GroupOutputs { m := NewAppModule(in.Cdc, k, in.AccountKeeper, in.BankKeeper, in.Registry) return GroupOutputs{GroupKeeper: k, Module: runtime.WrapAppModule(m)} } - -// ____________________________________________________________________________ - -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the group module. -func (AppModule) GenerateGenesisState(simState *module.SimulationState) { - simulation.RandomizedGenState(simState) -} - -// ProposalContents returns all the group content functions used to -// simulate governance proposals. -func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - -// RegisterStoreDecoder registers a decoder for group module's types -func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { - sdr[group.StoreKey] = simulation.NewDecodeStore(am.cdc) -} - -// WeightedOperations returns the all the gov module operations with their respective weights. -func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - return simulation.WeightedOperations( - am.registry, - simState.AppParams, simState.Cdc, - am.accKeeper, am.bankKeeper, am.keeper, am.cdc, - ) -} diff --git a/x/mint/module.go b/x/mint/module.go index 8ce235b718..5724ef3787 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -197,9 +197,9 @@ func (AppModule) WeightedOperations(_ module.SimulationState) []simtypes.Weighte return nil } -// ============================================================================ -// New App Wiring Setup -// ============================================================================ +// +// App Wiring Setup +// func init() { appmodule.Register(&modulev1.Module{}, @@ -218,7 +218,6 @@ type MintInputs struct { Config *modulev1.Module Key *store.KVStoreKey Cdc codec.Codec - Authority map[string]sdk.AccAddress `optional:"true"` InflationCalculationFn types.InflationCalculationFn `optional:"true"` // LegacySubspace is used solely for migration of x/params managed parameters @@ -242,10 +241,10 @@ func ProvideModule(in MintInputs) MintOutputs { feeCollectorName = authtypes.FeeCollectorName } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( diff --git a/x/nft/module/module.go b/x/nft/module/module.go index 247de946df..9bbb20d1f4 100644 --- a/x/nft/module/module.go +++ b/x/nft/module/module.go @@ -173,7 +173,7 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp } // -// New App Wiring Setup +// App Wiring Setup // func init() { diff --git a/x/params/module.go b/x/params/module.go index fed35120c1..d0a3a3a0c4 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -129,7 +129,7 @@ func (am AppModule) ExportGenesis(_ sdk.Context, _ codec.JSONCodec) json.RawMess func (AppModule) ConsensusVersion() uint64 { return 1 } // -// New App Wiring Setup +// App Wiring Setup // func init() { diff --git a/x/slashing/keeper/keeper_test.go b/x/slashing/keeper/keeper_test.go index 2d68306183..583d157e2b 100644 --- a/x/slashing/keeper/keeper_test.go +++ b/x/slashing/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" @@ -15,12 +14,10 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/slashing/testutil" - slashingtestutil "github.com/cosmos/cosmos-sdk/x/slashing/testutil" - - slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" - + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper" + slashingtestutil "github.com/cosmos/cosmos-sdk/x/slashing/testutil" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" ) @@ -52,10 +49,10 @@ func (s *KeeperTestSuite) SetupTest() { encCfg.Amino, key, s.stakingKeeper, - sdk.AccAddress(crypto.AddressHash([]byte(govtypes.ModuleName))).String(), + authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) // set test params - s.slashingKeeper.SetParams(ctx, testutil.TestParams()) + s.slashingKeeper.SetParams(ctx, slashingtestutil.TestParams()) slashingtypes.RegisterInterfaces(encCfg.InterfaceRegistry) queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) diff --git a/x/slashing/module.go b/x/slashing/module.go index 9380d4f2e1..80fe2828d3 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -192,9 +192,9 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp ) } -// ============================================================================ -// New App Wiring Setup -// ============================================================================ +// +// App Wiring Setup +// func init() { appmodule.Register( @@ -213,11 +213,10 @@ func ProvideModuleBasic() runtime.AppModuleBasicWrapper { type SlashingInputs struct { depinject.In - ModuleKey depinject.OwnModuleKey + Config *modulev1.Module Key *store.KVStoreKey Cdc codec.Codec LegacyAmino *codec.LegacyAmino - Authority map[string]sdk.AccAddress `optional:"true"` AccountKeeper types.AccountKeeper BankKeeper types.BankKeeper @@ -236,10 +235,10 @@ type SlashingOutputs struct { } func ProvideModule(in SlashingInputs) SlashingOutputs { - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper(in.Cdc, in.LegacyAmino, in.Key, in.StakingKeeper, authority.String()) diff --git a/x/staking/module.go b/x/staking/module.go index 69dd6c84c1..9b89afa21d 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -205,8 +205,7 @@ type StakingInputs struct { BankKeeper types.BankKeeper Cdc codec.Codec Key *store.KVStoreKey - ModuleKey depinject.OwnModuleKey - Authority map[string]sdk.AccAddress `optional:"true"` + // LegacySubspace is used solely for migration of x/params managed parameters LegacySubspace exported.Subspace } @@ -220,10 +219,10 @@ type StakingOutputs struct { } func ProvideModule(in StakingInputs) StakingOutputs { - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } k := keeper.NewKeeper( diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 1568e21d58..9aa94e3bb6 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -139,7 +139,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { } // -// New App Wiring Setup +// App Wiring Setup // func init() { @@ -155,13 +155,11 @@ func ProvideModuleBasic() runtime.AppModuleBasicWrapper { type UpgradeInputs struct { depinject.In - ModuleKey depinject.OwnModuleKey - Config *modulev1.Module - Key *store.KVStoreKey - Cdc codec.Codec + Config *modulev1.Module + Key *store.KVStoreKey + Cdc codec.Codec - AppOpts servertypes.AppOptions `optional:"true"` - Authority map[string]sdk.AccAddress `optional:"true"` + AppOpts servertypes.AppOptions `optional:"true"` } type UpgradeOutputs struct { @@ -186,10 +184,10 @@ func ProvideModule(in UpgradeInputs) UpgradeOutputs { homePath = cast.ToString(in.AppOpts.Get(flags.FlagHome)) } - authority, ok := in.Authority[depinject.ModuleKey(in.ModuleKey).Name()] - if !ok { - // default to governance authority if not provided - authority = authtypes.NewModuleAddress(govtypes.ModuleName) + // default to governance authority if not provided + authority := authtypes.NewModuleAddress(govtypes.ModuleName) + if in.Config.Authority != "" { + authority = authtypes.NewModuleAddressOrBech32Address(in.Config.Authority) } // set the governance module account as the authority for conducting upgrades