From 89ea3fe0a19ae9644272a130de6b9e52d19dd8b2 Mon Sep 17 00:00:00 2001 From: Tung Bui Date: Sun, 9 Apr 2023 11:36:09 +0700 Subject: [PATCH 1/3] removing wasmEnabledProposals []wasm.ProposalType from NewOsmosisApp --- app/app.go | 3 ++- app/config.go | 1 - app/modules_test.go | 2 +- app/test_helpers.go | 4 ++-- cmd/osmosisd/cmd/root.go | 3 +-- tests/simulator/osmosis_helper.go | 1 - 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 8fdffc39a66..844687b505e 100644 --- a/app/app.go +++ b/app/app.go @@ -179,7 +179,6 @@ func NewOsmosisApp( homePath string, invCheckPeriod uint, appOpts servertypes.AppOptions, - wasmEnabledProposals []wasm.ProposalType, wasmOpts []wasm.Option, baseAppOptions ...func(*baseapp.BaseApp), ) *OsmosisApp { @@ -204,6 +203,8 @@ func NewOsmosisApp( invCheckPeriod: invCheckPeriod, } + wasmEnabledProposals := GetWasmEnabledProposals() + wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) // Uncomment this for debugging contracts. In the future this could be made into a param passed by the tests diff --git a/app/config.go b/app/config.go index 6d271c9b836..052f2e76296 100644 --- a/app/config.go +++ b/app/config.go @@ -52,7 +52,6 @@ func NewAppConstructor() network.AppConstructor { return NewOsmosisApp( val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0, simapp.EmptyAppOptions{}, - GetWasmEnabledProposals(), EmptyWasmOpts, baseapp.SetMinGasPrices(val.AppConfig.MinGasPrices), ) diff --git a/app/modules_test.go b/app/modules_test.go index 3790e3aaebf..e2e7cda9820 100644 --- a/app/modules_test.go +++ b/app/modules_test.go @@ -12,7 +12,7 @@ import ( func TestOrderEndBlockers_Determinism(t *testing.T) { db := dbm.NewMemDB() - app := NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simapp.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts) + app := NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simapp.EmptyAppOptions{}, EmptyWasmOpts) for i := 0; i < 1000; i++ { a := OrderEndBlockers(app.mm.ModuleNames()) diff --git a/app/test_helpers.go b/app/test_helpers.go index 331e7c15804..83a12f8cb63 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -29,7 +29,7 @@ func getDefaultGenesisStateBytes() []byte { // Setup initializes a new OsmosisApp. func Setup(isCheckTx bool) *OsmosisApp { db := dbm.NewMemDB() - app := NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, simapp.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts) + app := NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, simapp.EmptyAppOptions{}, EmptyWasmOpts) if !isCheckTx { stateBytes := getDefaultGenesisStateBytes() @@ -56,7 +56,7 @@ func SetupTestingAppWithLevelDb(isCheckTx bool) (app *OsmosisApp, cleanupFn func if err != nil { panic(err) } - app = NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simapp.EmptyAppOptions{}, GetWasmEnabledProposals(), EmptyWasmOpts) + app = NewOsmosisApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, simapp.EmptyAppOptions{}, EmptyWasmOpts) if !isCheckTx { genesisState := NewDefaultGenesisState() stateBytes, err := json.MarshalIndent(genesisState, "", " ") diff --git a/cmd/osmosisd/cmd/root.go b/cmd/osmosisd/cmd/root.go index 8c8415a293e..dbfcd8b1dc5 100644 --- a/cmd/osmosisd/cmd/root.go +++ b/cmd/osmosisd/cmd/root.go @@ -295,7 +295,6 @@ func newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts serverty cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), appOpts, - osmosis.GetWasmEnabledProposals(), wasmOpts, baseapp.SetPruning(pruningOpts), baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), @@ -319,7 +318,7 @@ func createOsmosisAppAndExport( encCfg.Marshaler = codec.NewProtoCodec(encCfg.InterfaceRegistry) loadLatest := height == -1 homeDir := cast.ToString(appOpts.Get(flags.FlagHome)) - app := osmosis.NewOsmosisApp(logger, db, traceStore, loadLatest, map[int64]bool{}, homeDir, 0, appOpts, osmosis.GetWasmEnabledProposals(), osmosis.EmptyWasmOpts) + app := osmosis.NewOsmosisApp(logger, db, traceStore, loadLatest, map[int64]bool{}, homeDir, 0, appOpts, osmosis.EmptyWasmOpts) if !loadLatest { if err := app.LoadHeight(height); err != nil { diff --git a/tests/simulator/osmosis_helper.go b/tests/simulator/osmosis_helper.go index 65298454436..c37df23f1e2 100644 --- a/tests/simulator/osmosis_helper.go +++ b/tests/simulator/osmosis_helper.go @@ -24,7 +24,6 @@ func OsmosisAppCreator(logger log.Logger, db db.DB) simtypes.AppCreator { homepath, legacyInvariantPeriod, emptyAppOptions{}, - app.GetWasmEnabledProposals(), app.EmptyWasmOpts, baseappOptions...) } From 712a6cb46bda43d8fc2308f13b8a698cd3ac100b Mon Sep 17 00:00:00 2001 From: "Tung Bui Quang (Leo)" Date: Sun, 9 Apr 2023 11:52:33 +0700 Subject: [PATCH 2/3] update var init location --- app/app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 844687b505e..ad6b94aa400 100644 --- a/app/app.go +++ b/app/app.go @@ -188,6 +188,7 @@ func NewOsmosisApp( appCodec := encodingConfig.Marshaler cdc := encodingConfig.Amino interfaceRegistry := encodingConfig.InterfaceRegistry + wasmEnabledProposals := GetWasmEnabledProposals() bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) @@ -203,8 +204,6 @@ func NewOsmosisApp( invCheckPeriod: invCheckPeriod, } - wasmEnabledProposals := GetWasmEnabledProposals() - wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) // Uncomment this for debugging contracts. In the future this could be made into a param passed by the tests From c09944feb6f05b39e109ace65eee2c6d968cccb3 Mon Sep 17 00:00:00 2001 From: "Tung Bui (Leo)" <85242618+tungbq@users.noreply.github.com> Date: Mon, 10 Apr 2023 15:51:27 +0700 Subject: [PATCH 3/3] Update API breaking changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa6001fa312..b4bffa120af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#4658](https://github.com/osmosis-labs/osmosis/pull/4658) Deprecate x/gamm Pool query. The new one is located in x/poolmanager. * [#4682](https://github.com/osmosis-labs/osmosis/pull/4682) Deprecate x/gamm SpotPrice v2 query. The new one is located in x/poolmanager. * [#4801](https://github.com/osmosis-labs/osmosis/pull/4801) remove GetTotalShares, GetTotalLiquidity and GetExitFee from PoolI. Define all on CFMMPoolI, define GetTotalLiquidity on PoolModuleI only. +* [#4868](https://github.com/osmosis-labs/osmosis/pull/4868) Remove wasmEnabledProposals []wasm.ProposalType from NewOsmosisApp ## v15.0.0