Skip to content

Commit

Permalink
Revert "allow devnet with custom key gov"
Browse files Browse the repository at this point in the history
This reverts commit 2457d87.
  • Loading branch information
RustNinja committed Mar 7, 2024
1 parent be3b7ff commit 35247a7
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 1,664 deletions.
2 changes: 0 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ func NewComposableApp(
encodingConfig EncodingConfig,
appOpts servertypes.AppOptions,
wasmOpts []wasm.Option,
devnetGov *string,
baseAppOptions ...func(*baseapp.BaseApp),
) *ComposableApp {
appCodec := encodingConfig.Marshaler
Expand Down Expand Up @@ -337,7 +336,6 @@ func NewComposableApp(
appOpts,
wasmOpts,
enabledProposals,
devnetGov,
)

// transferModule := transfer.NewAppModule(app.TransferKeeper)
Expand Down
1 change: 0 additions & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func setup(withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*composa
encCdc,
EmptyAppOptions{},
opts,
nil,
)
if withGenesis {
return app, composable.NewDefaultGenesisState()
Expand Down
10 changes: 2 additions & 8 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appOpts servertypes.AppOptions,
wasmOpts []wasm.Option,
enabledProposals []wasm.ProposalType,
devnetGov *string,
) {
// add keepers
appKeepers.AccountKeeper = authkeeper.NewAccountKeeper(
Expand Down Expand Up @@ -259,12 +258,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appCodec, appKeepers.keys[ibchost.StoreKey], appKeepers.GetSubspace(ibchost.ModuleName), appKeepers.StakingKeeper, appKeepers.UpgradeKeeper, appKeepers.ScopedIBCKeeper,
)

govModuleAuthority := authtypes.NewModuleAddress(govtypes.ModuleName).String()
if devnetGov != nil {
govModuleAuthority = *devnetGov
}

appKeepers.Wasm08Keeper = wasm08Keeper.NewKeeper(appCodec, appKeepers.keys[wasm08types.StoreKey], govModuleAuthority, homePath, &appKeepers.IBCKeeper.ClientKeeper)
appKeepers.Wasm08Keeper = wasm08Keeper.NewKeeper(appCodec, appKeepers.keys[wasm08types.StoreKey], authorityAddress, homePath, &appKeepers.IBCKeeper.ClientKeeper)

// ICA Host keeper
appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper(
Expand Down Expand Up @@ -408,7 +402,7 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
wasmDir,
wasmConfig,
availableCapabilities,
govModuleAuthority,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)

Expand Down
1 change: 0 additions & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func setup(tb testing.TB, withGenesis bool, invCheckPeriod uint) (*ComposableApp
MakeEncodingConfig(),
EmptyBaseAppOptions{},
wasmOpts,
nil,
baseAppOpts...)
if withGenesis {
return app, NewDefaultGenesisState()
Expand Down
19 changes: 3 additions & 16 deletions cmd/centaurid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ import (
// this line is used by starport scaffolding # stargate/root/import
)

const (
// if set, than uses specific key for governance instead of default (default is production; this override for local devtest)
flagDevnetGov = "devnet-gov"
)

var ChainID string

// NewRootCmd creates a new root command for simd. It is called once in the
Expand Down Expand Up @@ -80,6 +75,7 @@ func NewRootCmd() (*cobra.Command, app.EncodingConfig) {
if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil {
return err
}

customAppTemplate, customAppConfig := initAppConfig()

customTMConfig := initTendermintConfig()
Expand Down Expand Up @@ -188,8 +184,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) {
// this line is used by starport scaffolding # stargate/root/commands
)

appCreator := appCreator{encodingConfig}
server.AddCommands(rootCmd, app.DefaultNodeHome, appCreator.newApp, appCreator.appExport, addModuleInitFlags)
a := appCreator{encodingConfig}
server.AddCommands(rootCmd, app.DefaultNodeHome, a.newApp, a.appExport, addModuleInitFlags)

// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
Expand All @@ -202,7 +198,6 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig app.EncodingConfig) {

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
startCmd.Flags().String(flagDevnetGov, "", "Sets the devnet governance key (if not set, uses the default production key)")
// this line is used by starport scaffolding # stargate/root/initFlags
}

Expand Down Expand Up @@ -272,11 +267,6 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
skipUpgradeHeights[h] = true
}

var devnetGov *string
devnetGovOption, _ := appOpts.Get(flagDevnetGov).(string)
if devnetGovOption != "" {
devnetGov = &devnetGovOption
}
baseappOptions := server.DefaultBaseappOptions(appOpts)

var emptyWasmOpts []wasm.Option
Expand All @@ -290,7 +280,6 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
// this line is used by starport scaffolding # stargate/root/appArgument
appOpts,
emptyWasmOpts,
devnetGov,
baseappOptions...,
)

Expand Down Expand Up @@ -323,7 +312,6 @@ func (a appCreator) appExport(
a.encCfg,
appOpts,
emptyWasmOpts,
nil,
)

if err := anApp.LoadHeight(height); err != nil {
Expand All @@ -342,7 +330,6 @@ func (a appCreator) appExport(
a.encCfg,
appOpts,
emptyWasmOpts,
nil,
)
}

Expand Down
Loading

0 comments on commit 35247a7

Please sign in to comment.