Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query genesis transactions #4788

Merged
merged 18 commits into from
Aug 1, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reflect pr comments
  • Loading branch information
colin-axner committed Aug 1, 2019
commit a6d6ff1f34154c6586ea23b2b8b3a30150c3e37b
7 changes: 4 additions & 3 deletions x/auth/client/rest/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func QueryTxsRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return
}

// if the height query param is set to zero, query for genesis transactions
heightStr := r.FormValue("height")
if heightStr != "" {
if height, err := strconv.ParseInt(heightStr, 10, 64); err == nil && height == 0 {
Expand All @@ -73,7 +74,7 @@ func QueryTxsRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
}

var (
tags []string
events []string
txs []sdk.TxResponse
page, limit int
)
Expand All @@ -88,13 +89,13 @@ func QueryTxsRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc {
return
}

tags, page, limit, err = rest.ParseHTTPArgs(r)
events, page, limit, err = rest.ParseHTTPArgs(r)
if err != nil {
rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
return
}

searchResult, err := utils.QueryTxsByEvents(cliCtx, tags, page, limit)
searchResult, err := utils.QueryTxsByEvents(cliCtx, events, page, limit)
if err != nil {
rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
return
Expand Down