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

Trades for account endpoint: pagination doesn't work #486

Closed
morleyzhi opened this issue Jun 5, 2018 · 0 comments · Fixed by #492
Closed

Trades for account endpoint: pagination doesn't work #486

morleyzhi opened this issue Jun 5, 2018 · 0 comments · Fixed by #492

Comments

@morleyzhi
Copy link

Here's a sample call to get trades on an account:

https://horizon.stellar.org/accounts/GAH3MQ6IJZ7QA4LT657AGUTVR7H3B3QQKBZ4Y4FKIASU7USAO5QTMH2X/trades?limit=2&order=desc

The links look like this:

  "_links": {
    "self": {
      "href": "https://horizon.stellar.org/accounts/GAH3MQ6IJZ7QA4LT657AGUTVR7H3B3QQKBZ4Y4FKIASU7USAO5QTMH2X/trades?cursor=\u0026limit=2\u0026order=desc"
    },
    "next": {
      "href": "https://horizon.stellar.org/accounts/GAH3MQ6IJZ7QA4LT657AGUTVR7H3B3QQKBZ4Y4FKIASU7USAO5QTMH2X/trades?cursor=78015765944496129-0\u0026limit=2\u0026order=desc"
    },
    "prev": {
      "href": "https://horizon.stellar.org/accounts/GAH3MQ6IJZ7QA4LT657AGUTVR7H3B3QQKBZ4Y4FKIASU7USAO5QTMH2X/trades?cursor=78081642152878081-0\u0026limit=2\u0026order=asc"
    }
  }

One thing looks wrong on its face: The "next" link is the same as the "prev" link with a different ordering mechanism, whereas you'd expect the difference to be different cursors.

Visiting the next link loads the same records as the initial call.

tomerweller added a commit to tomerweller/go that referenced this issue Jun 6, 2018
add trades for account paging tests
closes stellar#486
tomerweller added a commit that referenced this issue Jun 6, 2018
fix trades account filter
add trades for account paging tests
closes #486
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

Successfully merging a pull request may close this issue.

1 participant