From af7a94d86e7f36807fa657fe876f215d458c503a Mon Sep 17 00:00:00 2001 From: Arham Chordia <43543921+arhamchordia@users.noreply.github.com> Date: Mon, 15 Jul 2024 19:56:38 +0530 Subject: [PATCH] Addressing PR comments from Stefano. --- app/app.go | 20 +----------- app/keepers/keepers.go | 23 +------------- app/modules.go | 1 - app/upgrades/v2/export_test.go | 7 ----- cmd/quasarnoded/cmd/root.go | 2 +- proto/osmosis/gamm/v1beta1/query.proto | 4 --- proto/osmosis/gamm/v1beta1/tx.proto | 4 --- .../quasarnode/qvesting/genesis.proto | 2 -- proto/quasarlabs/quasarnode/qvesting/tx.proto | 3 -- x/qvesting/client/cli/tx.go | 1 - x/qvesting/genesis.go | 3 -- x/qvesting/handler.go | 1 - x/qvesting/module.go | 1 - x/qvesting/types/codec.go | 2 -- x/qvesting/types/genesis.go | 2 -- x/qvesting/types/genesis_test.go | 8 ++--- x/tokenfactory/module.go | 31 ------------------- 17 files changed, 5 insertions(+), 110 deletions(-) delete mode 100644 app/upgrades/v2/export_test.go diff --git a/app/app.go b/app/app.go index 508604185..30f82f9ca 100644 --- a/app/app.go +++ b/app/app.go @@ -62,18 +62,6 @@ const ( ) var ( - // WasmProposalsEnabled enables all x/wasm proposals when it's value is "true" - // and EnableSpecificWasmProposals is empty. Otherwise, all x/wasm proposals - // are disabled. - WasmProposalsEnabled = "true" - - // EnableSpecificWasmProposals , if set, must be comma-separated list of values - // that are all a subset of "EnableAllProposals", which takes precedence over - // WasmProposalsEnabled. - // - // See: https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34 - EnableSpecificWasmProposals = "" - // EmptyWasmOpts defines a type alias for a list of wasm options. EmptyWasmOpts []wasmkeeper.Option @@ -100,9 +88,7 @@ func overrideWasmVariables() { } var ( - // todo - sdk47 check both are needed or not _ servertypes.Application = (*QuasarApp)(nil) - //_ simapp.QuasarApp = (*QuasarApp)(nil) ) func init() { @@ -248,7 +234,7 @@ func New( } reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) - /* TODO - SDK47 keeing in pending for now. Add this once local testing is wrapped. + /* TODO - SDK50 keeping in pending for now. // app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) // create the simulation manager and define the order of the modules for deterministic simulations app.sm = module.NewSimulationManager( @@ -272,7 +258,6 @@ func New( // qoracleModule, // TODO fix intergam genesis + testing first (right now, test code does not even compile...) // intergammModule, - // this line is used by starport scaffolding # stargate/app/appModule ) app.sm.RegisterStoreDecoders() */ @@ -434,8 +419,6 @@ func (app *QuasarApp) RegisterNodeService(clientCtx client.Context) { nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) } -// TODO AG: move the below function to a test package - // LegacyAmino returns SimApp's amino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable @@ -489,7 +472,6 @@ func (app *QuasarApp) RegisterTxService(clientCtx client.Context) { authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) } -// RegisterTendermintService TODO - SDK47 // RegisterTendermintService implements the Application.RegisterTendermintService method. func (app *QuasarApp) RegisterTendermintService(clientCtx client.Context) { tmservice.RegisterTendermintService( diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index f73bfc255..ea8423782 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -340,10 +340,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( ) appKeepers.ICAHostKeeper = &icaHostKeeper - //icaModule := - // - //icaHostIBCModule := icahost.NewIBCModule(appKeepers.ICAHostKeeper) - evidenceKeeper := evidencekeeper.NewKeeper( appCodec, appKeepers.keys[evidencetypes.StoreKey], appKeepers.StakingKeeper, appKeepers.SlashingKeeper, ) @@ -378,9 +374,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( ) appKeepers.EpochsKeeper = epochsmodulekeeper.NewKeeper(appCodec, appKeepers.keys[epochsmoduletypes.StoreKey]) - //epochsModule := - - //qoracleModule := appKeepers.QTransferKeeper = qtransferkeeper.NewKeeper( appCodec, @@ -388,7 +381,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.GetSubspace(qtransfertypes.ModuleName), appKeepers.AccountKeeper, ) - //qtranserModule := appKeepers.QOracleKeeper = qoraclemodulekeeper.NewKeeper( appCodec, @@ -411,11 +403,9 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.ScopedQOsmosisKeeper, appKeepers.QOracleKeeper, ) - //qosmoIBCModule := qosmo.NewIBCModule(app.QOsmosisKeeper) appKeepers.QOracleKeeper.RegisterPoolOracle(appKeepers.QOsmosisKeeper) appKeepers.QOracleKeeper.Seal() - //qoracleModule := qoraclemodule.NewAppModule(appCodec, appKeepers.QOracleKeeper, appKeepers.QOsmosisKeeper) appKeepers.QTransferKeeper = qtransferkeeper.NewKeeper( appCodec, @@ -423,7 +413,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.GetSubspace(qtransfertypes.ModuleName), appKeepers.AccountKeeper, ) - //qtranserModule := qtransfer.NewAppModule(appKeepers.QTransferKeeper) appKeepers.QVestingKeeper = *qvestingmodulekeeper.NewKeeper( appCodec, @@ -434,8 +423,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.BankKeeper, ) - //qvestingModule := - // Authz appKeepers.AuthzKeeper = authzkeeper.NewKeeper( appKeepers.keys[authzkeeper.StoreKey], @@ -458,10 +445,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( appKeepers.BankKeeper, appKeepers.DistrKeeper, ) - //tfModule := tfmodule.NewAppModule(appKeepers.TfKeeper, - // appKeepers.AccountKeeper, - // appKeepers.BankKeeper, - //) callback := owasm.NewCallbackPlugin(appKeepers.WasmKeeper, appKeepers.QTransferKeeper.GetQTransferAcc()) @@ -478,7 +461,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( wasmKeeper := wasmkeeper.NewKeeper( appCodec, appKeepers.keys[wasmtypes.StoreKey], - // app.GetSubspace(wasm.ModuleName), appKeepers.AccountKeeper, appKeepers.BankKeeper, appKeepers.StakingKeeper, @@ -517,9 +499,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers( // AddRoute(qoraclemoduletypes.ModuleName, qoracleIBCModule) appKeepers.IBCKeeper.SetRouter(ibcRouter) - - // todo : check if all keeper initialised (one check finished) - } // initParamsKeeper init params keeper and its subspaces @@ -577,7 +556,7 @@ func KVStoreKeys() []string { wasmtypes.StoreKey, qtransfertypes.StoreKey, tftypes.StoreKey, - qvestingmoduletypes.StoreKey, // TODO delete this if unused + qvestingmoduletypes.StoreKey, authzkeeper.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, diff --git a/app/modules.go b/app/modules.go index 39c67711c..b3f52611d 100644 --- a/app/modules.go +++ b/app/modules.go @@ -160,7 +160,6 @@ func appModules( qtransfer.NewAppModule(app.QTransferKeeper), tfmodule.NewAppModule(app.TfKeeper, app.AccountKeeper, app.BankKeeper), qvestingmodule.NewAppModule(appCodec, app.QVestingKeeper, app.AccountKeeper, app.BankKeeper), - // this line is used by starport scaffolding # stargate/app/appModule } } diff --git a/app/upgrades/v2/export_test.go b/app/upgrades/v2/export_test.go deleted file mode 100644 index d634581ef..000000000 --- a/app/upgrades/v2/export_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package v2 - -/* -func SetQVestingParams(ctx sdk.Context, icqKeeper *qvestingkeeper.Keeper) { - setQVestingParams(ctx, icqKeeper) -} -*/ diff --git a/cmd/quasarnoded/cmd/root.go b/cmd/quasarnoded/cmd/root.go index ad40c473d..275fe2a57 100644 --- a/cmd/quasarnoded/cmd/root.go +++ b/cmd/quasarnoded/cmd/root.go @@ -91,7 +91,7 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { // return tmcfg.DefaultConfig if no custom configuration is required for the application. func initTendermintConfig() *tmcfg.Config { cfg := tmcfg.DefaultConfig() - // TODO - SDK47 - Can get some ref for the default values from quicksilver + // TODO - SDK50 - Can get some ref for the default values from quicksilver // https://github.com/quicksilver-zone/quicksilver/blob/update/sdk47/cmd/quicksilverd/root.go#L137 return cfg } diff --git a/proto/osmosis/gamm/v1beta1/query.proto b/proto/osmosis/gamm/v1beta1/query.proto index af90cfbd8..60a6d63b0 100644 --- a/proto/osmosis/gamm/v1beta1/query.proto +++ b/proto/osmosis/gamm/v1beta1/query.proto @@ -73,7 +73,6 @@ message QueryPoolRequest { uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; } message QueryPoolResponse { - // google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "PoolI" ]; google.protobuf.Any pool = 1 [ (cosmos_proto.accepts_interface) = "osmosis.gamm.v1beta1.Pool" ]; } @@ -83,9 +82,6 @@ message QueryPoolsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 2; } message QueryPoolsResponse { - // repeated google.protobuf.Any pools = 1 - // [ (cosmos_proto.accepts_interface) = "PoolI" ]; - repeated google.protobuf.Any pools = 1 [ (cosmos_proto.accepts_interface) = "osmosis.gamm.v1beta1.Pool" ]; // pagination defines the pagination in the response. diff --git a/proto/osmosis/gamm/v1beta1/tx.proto b/proto/osmosis/gamm/v1beta1/tx.proto index cdbca0b8d..72189c0b0 100644 --- a/proto/osmosis/gamm/v1beta1/tx.proto +++ b/proto/osmosis/gamm/v1beta1/tx.proto @@ -146,10 +146,6 @@ message MsgJoinSwapExternAmountIn { (gogoproto.moretags) = "yaml:\"share_out_min_amount\"", (gogoproto.nullable) = false ]; - // repeated cosmos.base.v1beta1.Coin tokensIn = 5 [ - // (gogoproto.moretags) = "yaml:\"tokens_in\"", - // (gogoproto.nullable) = false - // ]; } message MsgJoinSwapExternAmountInResponse { diff --git a/proto/quasarlabs/quasarnode/qvesting/genesis.proto b/proto/quasarlabs/quasarnode/qvesting/genesis.proto index 8bf28ece3..990769d97 100644 --- a/proto/quasarlabs/quasarnode/qvesting/genesis.proto +++ b/proto/quasarlabs/quasarnode/qvesting/genesis.proto @@ -3,12 +3,10 @@ package quasarlabs.quasarnode.qvesting; import "gogoproto/gogo.proto"; import "quasarlabs/quasarnode/qvesting/params.proto"; -// this line is used by starport scaffolding # genesis/proto/import option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; // GenesisState defines the qvesting module's genesis state. message GenesisState { Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/quasarlabs/quasarnode/qvesting/tx.proto b/proto/quasarlabs/quasarnode/qvesting/tx.proto index 9b9aa6a4a..0708f12c2 100644 --- a/proto/quasarlabs/quasarnode/qvesting/tx.proto +++ b/proto/quasarlabs/quasarnode/qvesting/tx.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package quasarlabs.quasarnode.qvesting; -// this line is used by starport scaffolding # proto/tx/import import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; @@ -10,7 +9,6 @@ option go_package = "github.com/quasarlabs/quasarnode/x/qvesting/types"; // Msg defines the Msg service. service Msg { rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); - // this line is used by starport scaffolding # proto/tx/rpc } message MsgCreateVestingAccount { @@ -27,4 +25,3 @@ message MsgCreateVestingAccount { message MsgCreateVestingAccountResponse { } -// this line is used by starport scaffolding # proto/tx/message diff --git a/x/qvesting/client/cli/tx.go b/x/qvesting/client/cli/tx.go index 1b33f33d7..4bfe8630d 100644 --- a/x/qvesting/client/cli/tx.go +++ b/x/qvesting/client/cli/tx.go @@ -24,7 +24,6 @@ func GetTxCmd() *cobra.Command { } cmd.AddCommand(CmdCreateVestingAccount()) - // this line is used by starport scaffolding # 1 return cmd } diff --git a/x/qvesting/genesis.go b/x/qvesting/genesis.go index 05eb83f9e..fa2d14666 100644 --- a/x/qvesting/genesis.go +++ b/x/qvesting/genesis.go @@ -10,7 +10,6 @@ import ( // InitGenesis initializes the capability module's state from a provided genesis // state. func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init k.SetParams(ctx, genState.Params) } @@ -19,7 +18,5 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() genesis.Params = k.GetParams(ctx) - // this line is used by starport scaffolding # genesis/module/export - return genesis } diff --git a/x/qvesting/handler.go b/x/qvesting/handler.go index 20c8cf419..3f54fabe7 100644 --- a/x/qvesting/handler.go +++ b/x/qvesting/handler.go @@ -22,7 +22,6 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgCreateVestingAccount: res, err := msgServer.CreateVestingAccount(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) - // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) return nil, errorsmod.Wrap(sdkerrors.ErrUnknownRequest, errMsg) diff --git a/x/qvesting/module.go b/x/qvesting/module.go index 2fabf1f88..20856c4d4 100644 --- a/x/qvesting/module.go +++ b/x/qvesting/module.go @@ -77,7 +77,6 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - // this line is used by starport scaffolding # 2 err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) if err != nil { return diff --git a/x/qvesting/types/codec.go b/x/qvesting/types/codec.go index c3baabbaa..20fd4cf1a 100644 --- a/x/qvesting/types/codec.go +++ b/x/qvesting/types/codec.go @@ -9,14 +9,12 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgCreateVestingAccount{}, "qvesting/CreateVestingAccount", nil) - // this line is used by starport scaffolding # 2 } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCreateVestingAccount{}, ) - // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/qvesting/types/genesis.go b/x/qvesting/types/genesis.go index 0e6aaf492..2fb67af14 100644 --- a/x/qvesting/types/genesis.go +++ b/x/qvesting/types/genesis.go @@ -3,7 +3,6 @@ package types // DefaultGenesis returns the default Capability genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default Params: DefaultParams(), } } @@ -11,7 +10,6 @@ func DefaultGenesis() *GenesisState { // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/qvesting/types/genesis_test.go b/x/qvesting/types/genesis_test.go index c054f0d38..775992581 100644 --- a/x/qvesting/types/genesis_test.go +++ b/x/qvesting/types/genesis_test.go @@ -21,13 +21,9 @@ func TestGenesisState_Validate(t *testing.T) { }, { desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, + genState: &types.GenesisState{}, + valid: true, }, - // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { err := tc.genState.Validate() diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go index f189a1d96..b9bc5c464 100644 --- a/x/tokenfactory/module.go +++ b/x/tokenfactory/module.go @@ -132,13 +132,6 @@ func (am AppModule) Route() sdk.Route { // QuerierRoute returns the x/tokenfactory module's query routing key. func (AppModule) QuerierRoute() string { return types.QuerierRoute } -/* -// LegacyQuerierHandler returns the x/tokenfactory module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} -*/ - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -178,27 +171,3 @@ func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { return []abci.ValidatorUpdate{} } - -// ___________________________________________________________________________ - -// AppModuleSimulationV2 functions -/* -// GenerateGenesisState creates a randomized GenState of the tokenfactory module. -func (am AppModule) SimulatorGenesisState(simState *module.SimulationState, s *simtypes.SimCtx) { - tfDefaultGen := types.DefaultGenesis() - tfDefaultGen.Params.DenomCreationFee = sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10000000))) - tfDefaultGenJson := simState.Cdc.MustMarshalJSON(tfDefaultGen) - simState.GenState[types.ModuleName] = tfDefaultGenJson -} -*/ -/* -// WeightedOperations returns the all the lockup module operations with their respective weights. -func (am AppModule) Actions() []simtypes.Action { - return []simtypes.Action{ - simtypes.NewMsgBasedAction("create token factory token", am.keeper, simulation.RandomMsgCreateDenom), - simtypes.NewMsgBasedAction("mint token factory token", am.keeper, simulation.RandomMsgMintDenom), - simtypes.NewMsgBasedAction("burn token factory token", am.keeper, simulation.RandomMsgBurnDenom), - simtypes.NewMsgBasedAction("change admin token factory token", am.keeper, simulation.RandomMsgChangeAdmin), - } -} -*/