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

REST /txs "tx.minheight" parameter does nothing, invalidates the query #5845

Closed
4 tasks
gsora opened this issue Mar 20, 2020 · 4 comments
Closed
4 tasks

REST /txs "tx.minheight" parameter does nothing, invalidates the query #5845

gsora opened this issue Mar 20, 2020 · 4 comments

Comments

@gsora
Copy link
Contributor

gsora commented Mar 20, 2020

Summary of Bug

The REST endpoint /txs accepts a given variety of parameters explained here.

The tx.minheight parameter should be used to filter transaction happened after a given block height.

Including said parameter in a REST call result in an empty result:

{"total_count":"0","count":"0","page_number":"1","page_total":"0","limit":"30","txs":[]}

Version

Cosmos-SDK v0.38.1

Steps to Reproduce

curl -X GET "https://api.cosmos.network/txs?message.action=send&message.sender=cosmos1tn755fln0uh5wugk4dths2m6dxjrdn93v8lq4t&tx.minheight=2" -H  "accept: application/json"

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@alexanderbez
Copy link
Contributor

/cc @gagbo

@gsora
Copy link
Contributor Author

gsora commented Mar 20, 2020

Directly querying Tendermint's /tx_search endpoint doesn't yield any meaningful result, except some sort of unmarshaling error:

curl -X GET "http://localhost:26657/tx_search?query=tx.height%3E%3D1&prove=false&page=1&per_page=100&order_by=desc" -H  "accept: application/json"

Result:

{
  "jsonrpc": "2.0",
  "id": -1,
  "error": {
    "code": -32602,
    "message": "Invalid params",
    "data": "error converting http params to arguments: invalid character 'x' in literal true (expecting 'r')"
  }
}
curl -X GET "http://localhost:26657/tx_search?query=tx.height%3D1&prove=false&page=1&per_page=100&order_by=desc" -H  "accept: application/json"

Result:

{
  "jsonrpc": "2.0",
  "id": -1,
  "error": {
    "code": -32602,
    "message": "Invalid params",
    "data": "error converting http params to arguments: invalid character 'x' in literal true (expecting 'r')"
  }
}

@gsora
Copy link
Contributor Author

gsora commented Mar 20, 2020

This is actually implemented in #5648, but https://cosmos.network/rpc/#/ already lists it, so I thought it was be available in 0.38.1.

Turns out I was wrong.

@gsora gsora closed this as completed Mar 20, 2020
@gagbo
Copy link
Contributor

gagbo commented Mar 21, 2020

I had the same weird surprise. The swagger lists it but it's not actually in the code.

For reference, 0.37.8 has the backport, No idea about 0.38 versions though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants