Skip to content

Commit

Permalink
Addressing PR comments from Stefano.
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamchordia committed Jul 15, 2024
1 parent 1732674 commit af7a94d
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 110 deletions.
20 changes: 1 addition & 19 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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() {
Expand Down Expand Up @@ -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(
Expand All @@ -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()
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
23 changes: 1 addition & 22 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -378,17 +374,13 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
)

appKeepers.EpochsKeeper = epochsmodulekeeper.NewKeeper(appCodec, appKeepers.keys[epochsmoduletypes.StoreKey])
//epochsModule :=

//qoracleModule :=

appKeepers.QTransferKeeper = qtransferkeeper.NewKeeper(
appCodec,
appKeepers.keys[qtransfertypes.ModuleName],
appKeepers.GetSubspace(qtransfertypes.ModuleName),
appKeepers.AccountKeeper,
)
//qtranserModule :=

appKeepers.QOracleKeeper = qoraclemodulekeeper.NewKeeper(
appCodec,
Expand All @@ -411,19 +403,16 @@ 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,
appKeepers.keys[qtransfertypes.ModuleName],
appKeepers.GetSubspace(qtransfertypes.ModuleName),
appKeepers.AccountKeeper,
)
//qtranserModule := qtransfer.NewAppModule(appKeepers.QTransferKeeper)

appKeepers.QVestingKeeper = *qvestingmodulekeeper.NewKeeper(
appCodec,
Expand All @@ -434,8 +423,6 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appKeepers.BankKeeper,
)

//qvestingModule :=

// Authz
appKeepers.AuthzKeeper = authzkeeper.NewKeeper(
appKeepers.keys[authzkeeper.StoreKey],
Expand All @@ -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())

Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
7 changes: 0 additions & 7 deletions app/upgrades/v2/export_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/quasarnoded/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 0 additions & 4 deletions proto/osmosis/gamm/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
}

Expand All @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions proto/osmosis/gamm/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions proto/quasarlabs/quasarnode/qvesting/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions proto/quasarlabs/quasarnode/qvesting/tx.proto
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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 {
Expand All @@ -27,4 +25,3 @@ message MsgCreateVestingAccount {
message MsgCreateVestingAccountResponse {
}

// this line is used by starport scaffolding # proto/tx/message
1 change: 0 additions & 1 deletion x/qvesting/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func GetTxCmd() *cobra.Command {
}

cmd.AddCommand(CmdCreateVestingAccount())
// this line is used by starport scaffolding # 1

return cmd
}
Expand Down
3 changes: 0 additions & 3 deletions x/qvesting/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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
}
1 change: 0 additions & 1 deletion x/qvesting/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion x/qvesting/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions x/qvesting/types/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 0 additions & 2 deletions x/qvesting/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ 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(),
}
}

// 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()
}
8 changes: 2 additions & 6 deletions x/qvesting/types/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
31 changes: 0 additions & 31 deletions x/tokenfactory/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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),
}
}
*/

0 comments on commit af7a94d

Please sign in to comment.