allora-network / allora-chain

Node software to run the Allora Network
https://www.allora.network/
Apache License 2.0
73 stars 67 forks source link

Fix pagination #406

Closed kpeluso closed 2 months ago

kpeluso commented 2 months ago

Fixes for pagination so they pass the newly added test cases.

The preexisting pagination method would fail to produce the desired page of topic ids when the set of active topics includes a non-consecutive set of topic ids. e.g. topic ids={1,2,3} but 2 is not active => GetIdsOfActiveTopics({limit:2}) would return {1} when it should return {1,3}, for any passed limit≥2.

Test cases for this and other behaviors added as well.