Skip to content

Bug fetching courts #235

@kyrers

Description

@kyrers

There is a bug in the logic to fetch court information.

The current logic initializes a counter to 0 (which effectively represents the court with ID 0) and attempts to estimate the gas required to retrieve that court information.
If the estimation is successful, it increases the counter (which in effect means moving onto the next court ID); If not, it assumes no more courts exist.

Currently, we have 25 courts on mainnet, with IDs from 0 to 24, respectively. Following this logic, counter = 25.
However, the loop to actually fetch each court data is: for (let i = 0; i < counter - 1; i++), so it misses the last court, because, using mainnet as an example, it will only fetch data as long as i < 24. If there is a dispute in court with ID 24, the court data will be missing, which will cause the application to crash.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions