Skip to content

Commit

Permalink
Addressing PR comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
arhamchordia committed Jul 15, 2024
1 parent 0ee381f commit 1732674
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 109 deletions.
3 changes: 0 additions & 3 deletions app/simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -48,7 +46,6 @@ func BenchmarkSimulation(b *testing.B) {
0,
encoding,
sims.EmptyAppOptions{},
// simapp.EmptyAppOptions{},
app.EmptyWasmOpts,
)

Expand Down
4 changes: 0 additions & 4 deletions cmd/quasarnoded/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))),
)
Expand All @@ -304,7 +301,6 @@ func (a appCreator) appExport(
if height == -1 {
loadLatest = true
}
// var emptyWasmOpts []wasm.Option

app := app.New(
logger,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"output-format": "json",
"sign-mode": "direct"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"output-format": "json",
"sign-mode": "direct"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"rule": null,
"channel-list": []
}
}
}
3 changes: 1 addition & 2 deletions x/epochs/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (

type (
Keeper struct {
cdc codec.Codec
// storeKey sdk.StoreKey
cdc codec.Codec
storeKey storetypes.StoreKey
hooks types.EpochHooks
}
Expand Down
25 changes: 1 addition & 24 deletions x/epochs/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 0 additions & 14 deletions x/qoracle/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
28 changes: 0 additions & 28 deletions x/qtransfer/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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(
Expand Down
1 change: 0 additions & 1 deletion x/qtransfer/testutils/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ func SetupTestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) {
app.DefaultNodeHome,
5,
encCdc,
// simapp.EmptyAppOptions{},
sims.EmptyAppOptions{},
app.EmptyWasmOpts,
)
Expand Down
17 changes: 1 addition & 16 deletions x/qtransfer/wasm_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand Down Expand Up @@ -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())
Expand All @@ -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 {
Expand Down
14 changes: 0 additions & 14 deletions x/tokenfactory/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -99,7 +95,6 @@ func NewMintCmd() *cobra.Command {
amount,
)

// return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg)

},
Expand All @@ -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
Expand All @@ -139,7 +133,6 @@ func NewBurnCmd() *cobra.Command {
amount,
)

// return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg)

},
Expand All @@ -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
Expand All @@ -175,7 +167,6 @@ func NewChangeAdminCmd() *cobra.Command {
args[1],
)

// return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg)

},
Expand All @@ -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
Expand All @@ -222,7 +211,6 @@ func NewMintToCmd() *cobra.Command {
toAddr.String(),
)

// return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
return tx.GenerateOrBroadcastTxWithFactory(clientCtx, fac, msg)

},
Expand All @@ -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
Expand Down

0 comments on commit 1732674

Please sign in to comment.