Skip to content

Commit 441ea42

Browse files
committed
fix(count): fix count calculation burned IDs
The reason that we didn't see any FVM hypercerts were because there were exactly as many certs as filtered IDs. The getAllHypercerts method filtered out burned IDs and always substracted the length of the array from the count returned by the API. Which, led to 0, which led to 'no hypercerts found'
1 parent 5e1ae95 commit 441ea42

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hypercerts/getAllHypercerts.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,12 @@ export async function getAllHypercerts({
192192
[],
193193
);
194194

195-
const totalCount = Math.max(
196-
0,
197-
(res.hypercerts.count ?? 0) - filteredIds.size,
198-
);
195+
const difference = res.hypercerts?.count
196+
? res.hypercerts?.count - data.length
197+
: 0;
198+
const totalCount = res.hypercerts?.count
199+
? res.hypercerts?.count - difference
200+
: 0;
199201

200202
return {
201203
count: totalCount,

0 commit comments

Comments
 (0)