Skip to content

Commit

Permalink
feat: add an assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
kilted-andres committed Mar 19, 2024
1 parent 887b558 commit 4219dbc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/backend/revoker/subScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ export async function getEvents({
JSON.stringify(payloadForEventsListRequest, null, 2),
);

if (parameters.page <= 100) {
throw new Error(

Check failure on line 94 in src/backend/revoker/subScan.ts

View workflow job for this annotation

GitHub Actions / build

subScan › getEvents › should query the subscan API

Page 0 exceeds Subscan's paging limit of 100. at getEvents (src/backend/revoker/subScan.ts:94:11) at Object.<anonymous> (src/backend/revoker/subScan.test.ts:50:22)

Check failure on line 94 in src/backend/revoker/subScan.ts

View workflow job for this annotation

GitHub Actions / build

subScan › getEvents › should return the count when no events exist

Page 0 exceeds Subscan's paging limit of 100. at getEvents (src/backend/revoker/subScan.ts:94:11) at Object.<anonymous> (src/backend/revoker/subScan.test.ts:78:42)

Check failure on line 94 in src/backend/revoker/subScan.ts

View workflow job for this annotation

GitHub Actions / build

subScan › subScanEventGenerator › should iterate through pages in reverse order

Page 0 exceeds Subscan's paging limit of 100. at getEvents (src/backend/revoker/subScan.ts:94:11) at subScanEventGenerator (src/backend/revoker/subScan.ts:190:31) at Object.<anonymous> (src/backend/revoker/subScan.test.ts:102:24)

Check failure on line 94 in src/backend/revoker/subScan.ts

View workflow job for this annotation

GitHub Actions / build

subScan › should get events in batches if current block is higher than block range

Page 0 exceeds Subscan's paging limit of 100. at getEvents (src/backend/revoker/subScan.ts:94:11) at subScanEventGenerator (src/backend/revoker/subScan.ts:190:31) at Object.<anonymous> (src/backend/revoker/subScan.test.ts:142:22)
`Page ${parameters.page} exceeds Subscan's paging limit of 100.`,
);
}

const {
data: { count, events },
} = await got
Expand Down

0 comments on commit 4219dbc

Please sign in to comment.