From bfd2454468df26f6b69f4e54bbdd2e6d153a14fb Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 20 Nov 2024 17:32:15 +0100 Subject: [PATCH] chore: fix a few compiler errs in 08-wasm --- .../08-wasm/internal/types/store_test.go | 2 +- .../08-wasm/keeper/keeper_test.go | 4 ++-- modules/light-clients/08-wasm/module.go | 8 -------- .../08-wasm/testing/simapp/export.go | 18 +----------------- .../light-clients/08-wasm/types/types_test.go | 2 +- modules/light-clients/08-wasm/wasm_test.go | 4 ++-- 6 files changed, 7 insertions(+), 31 deletions(-) diff --git a/modules/light-clients/08-wasm/internal/types/store_test.go b/modules/light-clients/08-wasm/internal/types/store_test.go index 583ada4b16f..7234e70bb07 100644 --- a/modules/light-clients/08-wasm/internal/types/store_test.go +++ b/modules/light-clients/08-wasm/internal/types/store_test.go @@ -60,7 +60,7 @@ func GetSimApp(chain *ibctesting.TestChain) *simapp.SimApp { // setupTestingApp provides the duplicated simapp which is specific to the 08-wasm module on chain creation. func setupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, nil) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, nil) return app, app.DefaultGenesis() } diff --git a/modules/light-clients/08-wasm/keeper/keeper_test.go b/modules/light-clients/08-wasm/keeper/keeper_test.go index 77344db4a16..9de14a2c605 100644 --- a/modules/light-clients/08-wasm/keeper/keeper_test.go +++ b/modules/light-clients/08-wasm/keeper/keeper_test.go @@ -51,7 +51,7 @@ func init() { // setupTestingApp provides the duplicated simapp which is specific to the 08-wasm module on chain creation. func setupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, nil) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, nil) return app, app.DefaultGenesis() } @@ -113,7 +113,7 @@ func (suite *KeeperTestSuite) setupWasmWithMockVM() (ibctesting.TestingApp, map[ }) db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, suite.mockVM) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, suite.mockVM) // reset DefaultTestingAppInit to its original value ibctesting.DefaultTestingAppInit = setupTestingApp diff --git a/modules/light-clients/08-wasm/module.go b/modules/light-clients/08-wasm/module.go index c58ff717c45..c05b6737dc1 100644 --- a/modules/light-clients/08-wasm/module.go +++ b/modules/light-clients/08-wasm/module.go @@ -10,12 +10,10 @@ import ( "cosmossdk.io/core/appmodule" "cosmossdk.io/core/registry" - "cosmossdk.io/x/gov/simulation" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/client/cli" "github.com/cosmos/ibc-go/modules/light-clients/08-wasm/keeper" @@ -25,7 +23,6 @@ import ( var ( _ module.AppModule = (*AppModule)(nil) _ module.AppModuleBasic = (*AppModule)(nil) - _ module.HasProposalMsgs = (*AppModule)(nil) _ module.HasGenesis = (*AppModule)(nil) _ appmodule.HasConsensusVersion = (*AppModule)(nil) _ module.HasServices = (*AppModule)(nil) @@ -115,11 +112,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // ConsensusVersion implements AppModule/ConsensusVersion. func (AppModule) ConsensusVersion() uint64 { return 2 } -// ProposalMsgs returns msgs used for governance proposals for simulations. -func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { - return simulation.ProposalMsgs() -} - func (am AppModule) InitGenesis(ctx context.Context, bz json.RawMessage) error { var gs types.GenesisState err := am.cdc.UnmarshalJSON(bz, &gs) diff --git a/modules/light-clients/08-wasm/testing/simapp/export.go b/modules/light-clients/08-wasm/testing/simapp/export.go index bbdcf491ea0..45642fa1064 100644 --- a/modules/light-clients/08-wasm/testing/simapp/export.go +++ b/modules/light-clients/08-wasm/testing/simapp/export.go @@ -10,12 +10,10 @@ import ( "cosmossdk.io/x/staking" stakingtypes "cosmossdk.io/x/staking/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1" - cmttypes "github.com/cometbft/cometbft/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis @@ -43,24 +41,10 @@ func (app *SimApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAd } validators, err := staking.WriteValidators(ctx, app.StakingKeeper) - cmtValidators := []cmttypes.GenesisValidator{} - for _, val := range validators { - cmtPk, err := cryptocodec.ToCmtPubKeyInterface(val.PubKey) - if err != nil { - return servertypes.ExportedApp{}, err - } - cmtVal := cmttypes.GenesisValidator{ - Address: val.Address.Bytes(), - PubKey: cmtPk, - Power: val.Power, - Name: val.Name, - } - cmtValidators = append(cmtValidators, cmtVal) - } return servertypes.ExportedApp{ AppState: appState, - Validators: cmtValidators, + Validators: validators, Height: height, ConsensusParams: app.BaseApp.GetConsensusParams(ctx), }, err diff --git a/modules/light-clients/08-wasm/types/types_test.go b/modules/light-clients/08-wasm/types/types_test.go index f3c1b51afcb..88540fbd5e7 100644 --- a/modules/light-clients/08-wasm/types/types_test.go +++ b/modules/light-clients/08-wasm/types/types_test.go @@ -55,6 +55,6 @@ func GetSimApp(chain *ibctesting.TestChain) *simapp.SimApp { // setupTestingApp provides the duplicated simapp which is specific to the 08-wasm module on chain creation. func setupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, nil) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, nil) return app, app.DefaultGenesis() } diff --git a/modules/light-clients/08-wasm/wasm_test.go b/modules/light-clients/08-wasm/wasm_test.go index f1524d32a41..d47f678214e 100644 --- a/modules/light-clients/08-wasm/wasm_test.go +++ b/modules/light-clients/08-wasm/wasm_test.go @@ -64,7 +64,7 @@ func GetSimApp(chain *ibctesting.TestChain) *simapp.SimApp { // setupTestingApp provides the duplicated simapp which is specific to the 08-wasm module on chain creation. func setupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, nil) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, nil) return app, app.DefaultGenesis() } @@ -109,7 +109,7 @@ func (suite *WasmTestSuite) setupWasmWithMockVM() (ibctesting.TestingApp, map[st }) db := dbm.NewMemDB() - app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.EmptyAppOptions{}, suite.mockVM) + app := simapp.NewSimApp(log.NewNopLogger(), db, nil, true, simtestutil.AppOptionsMap{}, suite.mockVM) // reset DefaultTestingAppInit to its original value ibctesting.DefaultTestingAppInit = setupTestingApp