Skip to content

Commit

Permalink
Merge pull request #212
Browse files Browse the repository at this point in the history
Release v0.11.3
  • Loading branch information
bsrinivas8687 authored Aug 30, 2023
2 parents 54c28ae + 0426831 commit f4d20db
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
14 changes: 8 additions & 6 deletions cmd/sentinelhub/app_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/server"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
Expand All @@ -22,8 +23,7 @@ import (
)

type appCreator struct {
encCfg app.EncodingConfig
homeDir string
encCfg app.EncodingConfig
}

func (ac appCreator) NewApp(
Expand All @@ -47,7 +47,8 @@ func (ac appCreator) NewApp(
panic(err)
}

snapshotDir := filepath.Join(ac.homeDir, "data", "snapshots")
homeDir := cast.ToString(appOpts.Get(flags.FlagHome))
snapshotDir := filepath.Join(homeDir, "data", "snapshots")

snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
if err != nil {
Expand All @@ -64,7 +65,7 @@ func (ac appCreator) NewApp(
}

return app.NewApp(
appOpts, db, ac.encCfg, ac.homeDir, cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), true,
appOpts, db, ac.encCfg, homeDir, cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), true,
logger, cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), skipUpgradeHeights, traceWriter,
version.Version, wasmOpts, app.GetWasmEnabledProposals(app.DefaultWasmProposals),
baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))),
Expand All @@ -91,8 +92,9 @@ func (ac appCreator) AppExport(
appOpts servertypes.AppOptions,
) (servertypes.ExportedApp, error) {
v := app.NewApp(
appOpts, db, ac.encCfg, ac.homeDir, cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), height == -1,
logger, cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), map[int64]bool{}, traceWriter,
appOpts, db, ac.encCfg, cast.ToString(appOpts.Get(flags.FlagHome)),
cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), height == -1, logger,
cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)), map[int64]bool{}, traceWriter,
version.Version, nil, nil,
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/sentinelhub/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func NewRootCmd(homeDir string) *cobra.Command {
txCommand(),
)

creator := appCreator{encCfg: encCfg, homeDir: homeDir}
creator := appCreator{encCfg: encCfg}
server.AddCommands(cmd, homeDir, creator.NewApp, creator.AppExport, moduleInitFlags)

return cmd
Expand Down
12 changes: 8 additions & 4 deletions x/subscription/keeper/query_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,23 @@ func (q *queryServer) QuerySubscriptionsForAccount(c context.Context, req *types
store = prefix.NewStore(q.Store(ctx), types.GetSubscriptionForAccountKeyPrefix(addr))
)

pagination, err := query.Paginate(store, req.Pagination, func(key, _ []byte) error {
pagination, err := query.FilteredPaginate(store, req.Pagination, func(key, _ []byte, accumulate bool) (bool, error) {
if !accumulate {
return false, nil
}

v, found := q.GetSubscription(ctx, sdk.BigEndianToUint64(key))
if !found {
return fmt.Errorf("subscription for key %X does not exist", key)
return false, nil
}

item, err := codectypes.NewAnyWithValue(v)
if err != nil {
return err
return false, err
}

items = append(items, item)
return nil
return true, nil
})

if err != nil {
Expand Down

0 comments on commit f4d20db

Please sign in to comment.