Add logic to app.go to configure enabled proposals

This commit is contained in:
Ethan Frey
2020-07-27 19:20:25 +02:00
parent c9cf9a8bbf
commit 7b1a4de59d
5 changed files with 50 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ import (
"io"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
@@ -90,7 +89,8 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer) abci.Application
}
return app.NewWasmApp(logger, db, traceStore, true, invCheckPeriod,
wasm.DisableAllProposals, skipUpgradeHeights,
app.GetEnabledProposals(),
skipUpgradeHeights,
baseapp.SetPruning(pruningOpts),
baseapp.SetMinGasPrices(viper.GetString(server.FlagMinGasPrices)),
baseapp.SetHaltHeight(viper.GetUint64(server.FlagHaltHeight)),
@@ -103,7 +103,7 @@ func exportAppStateAndTMValidators(
) (json.RawMessage, []tmtypes.GenesisValidator, error) {
if height != -1 {
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1), wasm.DisableAllProposals, nil)
gapp := app.NewWasmApp(logger, db, traceStore, false, uint(1), app.GetEnabledProposals(), nil)
err := gapp.LoadHeight(height)
if err != nil {
return nil, nil, err
@@ -111,6 +111,6 @@ func exportAppStateAndTMValidators(
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
}
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1), wasm.DisableAllProposals, nil)
gapp := app.NewWasmApp(logger, db, traceStore, true, uint(1), app.GetEnabledProposals(), nil)
return gapp.ExportAppStateAndValidators(forZeroHeight, jailWhiteList)
}

View File

@@ -8,7 +8,6 @@ import (
"time"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/server"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
@@ -92,7 +91,7 @@ func replayTxs(rootDir string) error {
fmt.Fprintln(os.Stderr, "Creating application")
gapp := app.NewWasmApp(
// TODO: do we want to set skipUpgradeHieghts here?
ctx.Logger, appDB, traceStoreWriter, true, uint(1), wasm.DisableAllProposals, nil,
ctx.Logger, appDB, traceStoreWriter, true, uint(1), app.GetEnabledProposals(), nil,
baseapp.SetPruning(storetypes.PruneEverything))
// Genesis