terra-money / fcd-classic

Terra ETL + RestFul API Server
https://fcd.terra.dev/swagger
MIT License
63 stars 40 forks source link

Get txs list - `limit` not working #149

Closed anhcao142 closed 2 years ago

anhcao142 commented 2 years ago

When I try https://fcd.terra.dev/v1/txs?block=5837920&limit=10 it returns full block's txs instead of 10. Also when I try to set limit with any other value aside from 10 or 100 it returns a weird error.

{
  "type": "INVALID_REQUEST_ERROR",
  "message": "child \"limit\" fails because [\"limit\" must be one of [10, 100]]",
  "code": 400
}
rebaz88 commented 2 years ago

1- I checked the code and the part where it returns txs by block is missing the limit. So it is true, when you try to retreive data by block the limit does not work. It is a simple bug.

2- limit: Joi.number().default(10).valid(10, 100).description('Items per page') only 10 and 100 is allowed for limit. any other number will not work.

hanjukim commented 2 years ago

It is confirmed that limit=10 returns all txs instead of 10 results.