fix: stop dropping token labels with more than 100 rows - #118
Merged
Conversation
HtmlParser.selectAllLabels skipped any token label whose record count was >= 100 (the token page-size cap), so those categories were silently never pulled, and the urls it did emit lacked the "start" cursor that ApiParser.fetchTokens requires for pagination. Token labels are now always included with "?size=100&start=0", matching CheerioParser, and fetchTokens pages through them 100 rows at a time. The accounts guard (skip >= 10,000 to avoid freezing on labels like beacon-depositor) is unchanged. Adds a unit test that drives fetchTokens through a full 100-row page plus a 20-row page via a stubbed browser fetcher, and extends the labelcloud fixture tests to cover previously-dropped >100-row labels. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
scripts/HtmlParser/HtmlParser.tshad a long-standing TODO ("repull tokens which have a page length > 100").selectAllLabelsskipped any token label whose record count was >= 100 (the token page-size cap), so those categories were silently never pulled at all — in the etherscan labelcloud fixture alone that is 35 labels, includingdefi(2,101 tokens) andstablecoin. The URLs it did emit also lacked thestartcursor thatApiParser.fetchTokensrequires, which would crash that fetch path.Fix
HtmlParser.selectAllLabelsnow always includes token labels, emitting?size=100&start=0— matchingCheerioParser.selectAllLabels, the variantChainPulleruses at runtime.ApiParser.fetchTokenskeeps advancingstartby 100 until a page comes back with fewer than 100 rows, so all rows are captured.beacon-depositor) is unchanged.Tests
ApiParserunit test drivesfetchTokensthrough a full 100-row page plus a 20-row page via a stubbed browser fetcher (rows built from the realaave.jsonfixture HTML with unique addresses), asserting thestartcursor advances[0, 100]and all 120 unique rows are captured.defion etherscan/arbiscan/optimism,blockchainon bscscan) are now asserted present with the pagination cursor, and expected label counts updated (etherscan 899 → 934, bscscan 240 → 263, arbiscan 167 → 170, optimism 101 → 102).bun test:unit(31 pass),eslint, andtscall pass. Dataset intentionally not regenerated — code fix + tests only.🤖 Generated with Claude Code