From 173267472237840778855480373c27a4a9c79dd3 Mon Sep 17 00:00:00 2001 From: Arham Chordia <43543921+arhamchordia@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:09:41 +0530 Subject: [PATCH] Addressing PR comments. --- app/simulation_test.go | 3 -- cmd/quasarnoded/cmd/root.go | 4 --- .../go-relayer-config/chains/osmosis.json | 2 +- .../go-relayer-config/chains/quasar.json | 2 +- .../paths/quasar_osmosis.json | 2 +- x/epochs/keeper/keeper.go | 3 +- x/epochs/module.go | 25 +---------------- x/qoracle/module.go | 14 ---------- x/qtransfer/ibc_module.go | 28 ------------------- x/qtransfer/testutils/chain.go | 1 - x/qtransfer/wasm_hooks.go | 17 +---------- x/tokenfactory/client/cli/tx.go | 14 ---------- 12 files changed, 6 insertions(+), 109 deletions(-) diff --git a/app/simulation_test.go b/app/simulation_test.go index 100b08e8e..8bacb4e79 100644 --- a/app/simulation_test.go +++ b/app/simulation_test.go @@ -25,8 +25,6 @@ func init() { func BenchmarkSimulation(b *testing.B) { simapp.FlagEnabledValue = true simapp.FlagCommitValue = true - //sims.FlagEnabledValue = true - //sims.FlagCommitValue = true config, db, dir, logger, _, err := simapp.SetupSimulation("goleveldb-app-sim", "Simulation") require.NoError(b, err, "simulation setup failed") @@ -48,7 +46,6 @@ func BenchmarkSimulation(b *testing.B) { 0, encoding, sims.EmptyAppOptions{}, - // simapp.EmptyAppOptions{}, app.EmptyWasmOpts, ) diff --git a/cmd/quasarnoded/cmd/root.go b/cmd/quasarnoded/cmd/root.go index 3d1e9039f..ad40c473d 100644 --- a/cmd/quasarnoded/cmd/root.go +++ b/cmd/quasarnoded/cmd/root.go @@ -277,9 +277,6 @@ func (a appCreator) newApp( baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), baseapp.SetSnapshot(snapshotStore, snapshotOptions), - //baseapp.SetSnapshotStore(snapshotStore), - //baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))), - // baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))), baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))), ) @@ -304,7 +301,6 @@ func (a appCreator) appExport( if height == -1 { loadLatest = true } - // var emptyWasmOpts []wasm.Option app := app.New( logger, diff --git a/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/osmosis.json b/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/osmosis.json index 80d038981..5a231efc5 100644 --- a/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/osmosis.json +++ b/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/osmosis.json @@ -13,4 +13,4 @@ "output-format": "json", "sign-mode": "direct" } -} \ No newline at end of file +} diff --git a/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/quasar.json b/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/quasar.json index af02f5a01..7da2f4459 100644 --- a/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/quasar.json +++ b/demos/upgrade-handler/v2.0.0/go-relayer-config/chains/quasar.json @@ -13,4 +13,4 @@ "output-format": "json", "sign-mode": "direct" } -} \ No newline at end of file +} diff --git a/demos/upgrade-handler/v2.0.0/go-relayer-config/paths/quasar_osmosis.json b/demos/upgrade-handler/v2.0.0/go-relayer-config/paths/quasar_osmosis.json index 9cabcc088..8979f1b43 100644 --- a/demos/upgrade-handler/v2.0.0/go-relayer-config/paths/quasar_osmosis.json +++ b/demos/upgrade-handler/v2.0.0/go-relayer-config/paths/quasar_osmosis.json @@ -9,4 +9,4 @@ "rule": null, "channel-list": [] } -} \ No newline at end of file +} diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index 5982ab35a..db04421bb 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -13,8 +13,7 @@ import ( type ( Keeper struct { - cdc codec.Codec - // storeKey sdk.StoreKey + cdc codec.Codec storeKey storetypes.StoreKey hooks types.EpochHooks } diff --git a/x/epochs/module.go b/x/epochs/module.go index 209662c38..9ffd052ba 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -116,25 +116,9 @@ func (am AppModule) Name() string { return am.AppModuleBasic.Name() } -/* -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} -*/ - // QuerierRoute returns the capability module's query routing key. func (AppModule) QuerierRoute() string { return types.QuerierRoute } -/* -// LegacyQuerierHandler returns the x/epochs module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return func(sdk.Context, []string, abci.RequestQuery) ([]byte, error) { - return nil, fmt.Errorf("legacy querier not supported for the x/%s module", types.ModuleName) - } -} -*/ - // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { @@ -187,20 +171,13 @@ func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.We return nil } -/* -// RandomizedParams creates randomized pool-incentives param changes for the simulator. -func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { - return nil -} -*/ - // RegisterStoreDecoder registers a decoder for supply module's types. func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { } // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { - return nil // TODO + return nil } // ConsensusVersion implements AppModule/ConsensusVersion. diff --git a/x/qoracle/module.go b/x/qoracle/module.go index 402ecad7c..49358caa2 100644 --- a/x/qoracle/module.go +++ b/x/qoracle/module.go @@ -124,13 +124,6 @@ func NewAppModule( func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { } -/* -// Route implements the AppModule interface -func (AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, nil) -} -*/ - // NewHandler implements the AppModule interface func (AppModule) NewHandler() sdk.Handler { return nil @@ -141,13 +134,6 @@ func (AppModule) QuerierRoute() string { return types.QuerierRoute } -/* -// LegacyQuerierHandler implements the AppModule interface -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) { diff --git a/x/qtransfer/ibc_module.go b/x/qtransfer/ibc_module.go index 5bf782a6c..3529d52c8 100644 --- a/x/qtransfer/ibc_module.go +++ b/x/qtransfer/ibc_module.go @@ -231,18 +231,6 @@ func (im IBCMiddleware) OnTimeoutPacket( return err } -// TODO SDK47 -/* -// SendPacket implements the ICS4 Wrapper interface -func (im IBCMiddleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, -) error { - return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) -} -*/ - // SendPacket implements the ICS4 Wrapper interface func (im IBCMiddleware) SendPacket( ctx sdk.Context, @@ -253,24 +241,8 @@ func (im IBCMiddleware) SendPacket( timeoutTimestamp uint64, data []byte, ) (sequence uint64, err error) { - // TODO - SDK47 FIX return im.ICS4Middleware.SendPacket(ctx, chanCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data) - - // return 0, nil - // return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) -} - -/* -// SDK47 FIX - Trying to fix -// SendPacket implements the ICS4 Wrapper interface -func (im IBCMiddleware) SendPacket( - ctx sdk.Context, - chanCap *capabilitytypes.Capability, - packet ibcexported.PacketI, -) error { - return im.ICS4Middleware.SendPacket(ctx, chanCap, packet) } -*/ // WriteAcknowledgement implements the ICS4 Wrapper interface func (im IBCMiddleware) WriteAcknowledgement( diff --git a/x/qtransfer/testutils/chain.go b/x/qtransfer/testutils/chain.go index 249f269c7..5dc78cda4 100644 --- a/x/qtransfer/testutils/chain.go +++ b/x/qtransfer/testutils/chain.go @@ -27,7 +27,6 @@ func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { app.DefaultNodeHome, 5, encCdc, - // simapp.EmptyAppOptions{}, sims.EmptyAppOptions{}, app.EmptyWasmOpts, ) diff --git a/x/qtransfer/wasm_hooks.go b/x/qtransfer/wasm_hooks.go index 7ef5ccbbc..bb24b957c 100644 --- a/x/qtransfer/wasm_hooks.go +++ b/x/qtransfer/wasm_hooks.go @@ -26,14 +26,12 @@ type ContractAck struct { type WasmHooks struct { keeper keeper.Keeper // ibc hook keeper wasmKeeper wasmkeeper.Keeper // contract keeper - // permissionedKeeper *wasmkeeper.PermissionedKeeper } func NewWasmHooks(k keeper.Keeper, wasmKeeper wasmkeeper.Keeper) WasmHooks { return WasmHooks{ keeper: k, wasmKeeper: wasmKeeper, - // permissionedKeeper: wasmkeeper.NewDefaultPermissionKeeper(wasmKeeper), } } @@ -142,8 +140,7 @@ func MustExtractDenomFromPacketOnRecv(packet ibcexported.PacketI) string { return denom } -// TODO - SDK47 - +// TODO - SDK47 (address this) func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteContract) (*wasmtypes.MsgExecuteContractResponse, error) { if err := execMsg.ValidateBasic(); err != nil { return nil, fmt.Errorf(types.ErrBadExecutionMsg, err.Error()) @@ -152,18 +149,6 @@ func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteCon return wasmMsgServer.ExecuteContract(sdk.WrapSDKContext(ctx), execMsg) } -/* -func (h WasmHooks) execWasmMsg(ctx sdk.Context, execMsg *wasmtypes.MsgExecuteContract) (*wasmtypes.MsgExecuteContractResponse, error) { - - if err := execMsg.ValidateBasic(); err != nil { - return nil, errorsmod.Wrap(err, "invalid wasm contract execution message") - } - wasmMsgServer := wasmkeeper.NewMsgServerImpl(h.permissionedKeeper) - return wasmMsgServer.ExecuteContract(sdk.WrapSDKContext(ctx), execMsg) - - return nil, nil - } -*/ func isIcs20Packet(packet channeltypes.Packet) (isIcs20 bool, ics20data transfertypes.FungibleTokenPacketData) { var data transfertypes.FungibleTokenPacketData if err := json.Unmarshal(packet.GetData(), &data); err != nil { diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go index a626244b7..e8b928bdc 100644 --- a/x/tokenfactory/client/cli/tx.go +++ b/x/tokenfactory/client/cli/tx.go @@ -46,8 +46,6 @@ func NewCreateDenomCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err @@ -80,8 +78,6 @@ func NewMintCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err @@ -99,7 +95,6 @@ func NewMintCmd() *cobra.Command { amount, ) - // return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg) }, @@ -121,7 +116,6 @@ func NewBurnCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err @@ -139,7 +133,6 @@ func NewBurnCmd() *cobra.Command { amount, ) - // return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg) }, @@ -161,7 +154,6 @@ func NewChangeAdminCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err @@ -175,7 +167,6 @@ func NewChangeAdminCmd() *cobra.Command { args[1], ) - // return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg) }, @@ -197,8 +188,6 @@ func NewMintToCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err @@ -222,7 +211,6 @@ func NewMintToCmd() *cobra.Command { toAddr.String(), ) - // return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg) }, @@ -244,8 +232,6 @@ func NewBurnFromCmd() *cobra.Command { return err } - // txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - fac, err := tx.NewFactoryCLI(clientCtx, cmd.Flags()) if err != nil { return err