Skip to content

Commit

Permalink
chore: remove unused heightsByQuery function (#998)
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Apr 17, 2023
1 parent 0b55683 commit d23c70f
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions rpc/core/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,23 +470,6 @@ func BlockSearch(
return &ctypes.ResultBlockSearch{Blocks: apiResults, TotalCount: totalCount}, nil
}

// heightsByQuery returns a list of heights corresponding to the provided query.
func heightsByQuery(ctx *rpctypes.Context, query string) ([]int64, error) {
env := GetEnvironment()
// skip if block indexing is disabled
if _, ok := env.BlockIndexer.(*blockidxnull.BlockerIndexer); ok {
return nil, errors.New("block indexing is disabled")
}

q, err := cmtquery.New(query)
if err != nil {
return nil, err
}

results, err := env.BlockIndexer.Search(ctx.Context(), q)
return results, err
}

// sortBlocks takes a list of block heights and sorts them according to the order: "asc" or "desc".
// If `orderBy` is blank, then it is considered descending.
func sortBlocks(results []int64, orderBy string) error {
Expand Down

0 comments on commit d23c70f

Please sign in to comment.